pub struct SpscHeader {
pub magic: u64,
pub capacity: u64,
pub slot_size: u64,
pub head: AtomicU64,
pub tail: AtomicU64,
/* private fields */
}Expand description
Header layout for a Lamport SPSC ring. Three cache lines:
metadata, then producer-owned head, then consumer-owned tail.
Separate cache lines for head and tail eliminate false
sharing between producer and consumer hot paths.
Fields§
§magic: u64§capacity: u64§slot_size: u64§head: AtomicU64Producer-owned head counter; consumer reads via Acquire.
tail: AtomicU64Consumer-owned tail counter; producer reads via Acquire.
Auto Trait Implementations§
impl !Freeze for SpscHeader
impl RefUnwindSafe for SpscHeader
impl Send for SpscHeader
impl Sync for SpscHeader
impl Unpin for SpscHeader
impl UnsafeUnpin for SpscHeader
impl UnwindSafe for SpscHeader
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