pub struct SharedDequeFcl { /* private fields */ }Expand description
MMF-backed Fat Chase-Lev deque. Counter-only Chase-Lev protocol
with K_inner = 3 items per slot, single owner, N thieves.
Wraps SharedDeque<FatLineItem> with a
caller-facing publish_batch API that
packs LineItem payloads into 64-byte fat slots.
Implementations§
Sourcepub fn create<P: AsRef<Path>>(path: P, capacity_slots: usize) -> Result<Self>
pub fn create<P: AsRef<Path>>(path: P, capacity_slots: usize) -> Result<Self>
Create a fresh Fcl file. capacity_slots rounds up to the
next power of two. Total item capacity is
capacity_slots * LINE_ITEMS.
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Open an existing Fcl file as a thief (read-side).
Sourcepub fn capacity_slots(&self) -> usize
pub fn capacity_slots(&self) -> usize
Capacity in slots (power of two). Total item capacity is
capacity_slots() * LINE_ITEMS.
Sourcepub fn approx_len_slots(&self) -> usize
pub fn approx_len_slots(&self) -> usize
Snapshot the current ring fill in slots.
Sourcepub fn publish_batch(&self, items: &[LineItem]) -> Result<usize, DequeError>
pub fn publish_batch(&self, items: &[LineItem]) -> Result<usize, DequeError>
Owner-side batched publish. Packs items into
ceil(items.len() / LINE_ITEMS) fat slots, then publishes
them with ONE top load + ONE Release fence + ONE Relaxed
bottom store via SharedDeque::push_batch.
Cost: 1 top load + ceil(K/3) cache-line writes + 1 Release
fence + 1 bottom store. No per-slot atomic.
Returns the number of items published. Returns
Err(DequeError::Full) if the batch would overflow the ring.
Sourcepub fn steal_slot(&self) -> Option<FatLineItem>
pub fn steal_slot(&self) -> Option<FatLineItem>
Thief-side steal. Returns one fat slot (1..=LINE_ITEMS items)
or None if the ring is empty / CAS lost.