Skip to main content

Module bulk

Module bulk 

Source
Expand description

Bulk transfer extensions on the base SPSC ring.

try_enqueue_bulk(&[T]) and try_dequeue_bulk(&mut [T]) amortise the cost of the per-item atomic load + cache check by issuing exactly one acquire-load (only when the cached opposite-index is exhausted) and exactly one release-store per call. Items are still committed in the same order; consumers observing the new tail see all items that preceded it.

Returns the number of items actually transferred. A return < slice.len() means the ring couldn’t take the rest right now (full / empty); the caller decides whether to back off.