Expand description
Bounded MPSC queue: fixed-capacity ring buffer with backpressure.
Producers see backpressure via BoundedMpscQueue::try_enqueue
returning the rejected value when the ring is full. Single consumer
only (BoundedMpscQueue::try_dequeue takes &mut self).
Layout: power-of-two capacity, per-slot sequence numbers. Producers CAS the tail to claim a slot, then write the value and bump the slot’s sequence to publish. The consumer reads slots in order and advances head once each is consumed.
try_enqueue is wait-free in the uncontended case and bounded-retry
under contention (each retry corresponds to a competing producer
that won the CAS).
Structs§
- Bounded
Mpsc Queue - Bounded MPSC ring queue. Capacity is rounded up to the next power of two (minimum 2) so the modulo can be a bitmask.