Skip to main content

Module spsc

Module spsc 

Source
Expand description

Single-producer, single-consumer bounded FIFO queue.

Wait-free on both sides. Bounded with a compile-time power-of-two CAPACITY. See new for the heap-backed variant and new_hugepage_backed for the 2 MiB hugepage-backed variant (useful when the slot buffer is large enough to thrash the dTLB).

Structs§

Consumer
The popping handle of an SPSC FIFO queue.
Producer
The pushing handle of an SPSC FIFO queue.

Functions§

new
Creates a new heap-backed SPSC queue with CAPACITY slots.
new_hugepage_backed
Creates a new SPSC queue with CAPACITY slots backed by 2 MiB hugepages.