pub(crate) struct Inner<T: 'static> {
head: AtomicU64,
tail: AtomicU32,
buffer: Box<[UnsafeCell<MaybeUninit<Notified<T>>>; 256]>,
}
Fields§
§head: AtomicU64
Concurrently updated by many threads.
Contains two UnsignedShort
values. The LSB
byte is the “real” head of
the queue. The UnsignedShort
in the MSB
is set by a stealer in process
of stealing values. It represents the first value being stolen in the
batch. The UnsignedShort
indices are intentionally wider than strictly
required for buffer indexing in order to provide ABA mitigation and make
it possible to distinguish between full and empty buffers.
When both UnsignedShort
values are the same, there is no active
stealer.
Tracking an in-progress stealer prevents a wrapping scenario.
tail: AtomicU32
Only updated by producer thread but read by many threads.
buffer: Box<[UnsafeCell<MaybeUninit<Notified<T>>>; 256]>
Elements
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Inner<T>
impl<T> !RefUnwindSafe for Inner<T>
impl<T> Unpin for Inner<T>
impl<T> !UnwindSafe for Inner<T>
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