MPSC queue - Rust
Vyukov's multi-producer single-consumer linked queue. Producers swap the head; consumer walks next pointers. The dangling-tail window is the whole story.
Part of the submillisecond.com cookbook. Zero external dependencies; std only.
Install
[]
= "0.4"
Quickstart
Public API
pub enum PopResult<T>pub struct MpscQueue<T>pub fn new() -> Selfpub fn push(&self, value: T)pub fn try_pop(&mut self) -> PopResult<T>
Files
src/lib.rs- implementation.tests/- integration tests; correctness, edge cases, property/stress.examples/demo.rs- stdout walkthrough.examples/perf_main.rs- bench entry (behind theharnessfeature).
License
Dual-licensed under MIT OR Apache-2.0.