pub struct MpmcRing<T> { /* private fields */ }Expand description
Multi-producer multi-consumer ring buffer (Vyukov bounded MPMC queue).
Uses per-slot sequence counters to synchronize producers and consumers. A producer may only write a slot once its sequence matches the expected head value, and a consumer may only read once the sequence shows the write is complete. This eliminates the race where a consumer observes an advanced head but the slot has not been written yet.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for MpmcRing<T>
impl<T> !RefUnwindSafe for MpmcRing<T>
impl<T> Unpin for MpmcRing<T>
impl<T> UnsafeUnpin for MpmcRing<T>
impl<T> UnwindSafe for MpmcRing<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more