Skip to content

A non-blocking, single-writer/multiple-reader circular buffer for Rust

Notifications You must be signed in to change notification settings

BlackCAT-CubeSat/bc-buf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bc-buf

This Rust crate contains code for a single-writer, multiple-reader circular buffer structure. Specifically:

  • The writer and readers may be on different threads or (for types with a layout guarantee) even in different processes.
  • The circular buffers are nonblocking. The writer may add an item to a buffer at any time. As a result, it is possible that readers may miss items if they get too far behind the writer. (Readers will, with very high probability, recognize if and when this happens.)
  • No memory allocations are required after the buffer has been created.
  • The writer protocol is simple—simple enough that it can be easily implemented in FPGA logic.
  • Notifying readers when new items are available is beyond the scope of this crate.

The use-case this crate was created for is one in which event data continuously arrives (with no possiblity of flow control)—in some cases, from hardware—and needs to be communicated to other threads.

See the Rustdocs for details on how to use this crate.

About

A non-blocking, single-writer/multiple-reader circular buffer for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages