atomic_pingpong 0.2.3

Lightweight no_std ping-pong buffer, using AtomicU8 for synchronization
Documentation
  • Coverage
  • 100%
    16 out of 16 items documented0 out of 14 items with examples
  • Size
  • Source code size: 24.36 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.62 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dlaw/atomic_pingpong
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dlaw

A ping-pong buffer is a two-element buffer which alows for simultaneous access by a single producer and a single consumer. One element is reserved for writing by the producer, and the other element is reserved for reading by the consumer. When writing and reading are finished, the roles of the two elements are swapped (i.e. the one which was written will be next to be read, and the one which was read will be next to be overwritten). This approach avoids the need for memory copies, which improves performance when the element size is large.

This ping-pong buffer implementation uses an AtomicU8 for synchronization between the producer and consumer, resulting in thread-safety and interrupt-safety with minimum overhead. This implementation supports no_std environments, but requires a target which supports atomic compare and swap.