#[repr(C, align(64))]pub struct LohHeader {
pub magic: u64,
pub capacity: u64,
pub owner_pid: AtomicU64,
pub epoch: AtomicU64,
pub _pad_meta: [u8; 24],
pub tail: AtomicI64,
pub _pad_tail: [u8; 56],
pub head: AtomicI64,
pub _pad_head: [u8; 56],
}Expand description
File header. Cache-line aligned. head and tail each get their
own cache line so the producer-side tail.fetch_add does not
invalidate the consumer-side head line.
Fields§
§magic: u64Magic constant.
capacity: u64Number of ring slots; always a power of two.
owner_pid: AtomicU64Pid of the owner process; informational. Cleared on
close_owner().
epoch: AtomicU64Epoch counter advanced by the owner on shutdown.
_pad_meta: [u8; 24]Padding to push tail to its own cache line.
tail: AtomicI64Producer counter. Owner fetch_add(batch_size) during
migration to claim a contiguous block of slots.
_pad_tail: [u8; 56]Padding to push head to its own cache line.
head: AtomicI64Consumer counter. Thieves CAS this to claim a slot.
_pad_head: [u8; 56]Padding round to two whole cache lines after head.
Auto Trait Implementations§
impl !Freeze for LohHeader
impl RefUnwindSafe for LohHeader
impl Send for LohHeader
impl Sync for LohHeader
impl Unpin for LohHeader
impl UnsafeUnpin for LohHeader
impl UnwindSafe for LohHeader
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