Skip to main content

Module lockfree_ring

Module lockfree_ring 

Source
Expand description

Lock-free single-producer single-consumer ring buffer for zero-copy IPC.

§Memory layout

Each ring is backed by physically-contiguous DMA-accessible pages. The first page holds a RingHeader with cache-line-padded atomic head/tail indexes. Subsequent pages hold RingSlot entries.

§Ordering invariants

The producer writes data before publishing via tail.store(Release). The consumer reads data after observing via tail.load(Acquire). This guarantees correct ordering on x86 and ARM/POWER (no store-store reordering past the Release barrier). See also LockFreeRing::write.

Structs§

DmaBuffer
Descriptor for a DMA-accessible buffer region within the ring.
LockFreeRing
A lock-free single-producer single-consumer ring buffer.
RingHeader
Shared ring header, placed at the start of the first physical page.
RingSlot
A single slot within the ring.

Enums§

RingError
Errors returned by ring operations.

Constants§

SLOT_FLAG_COMMITTED 🔒