subms-spsc-ring-buffer 0.5.2

submillisecond.com cookbook recipe - concurrency: subms-spsc-ring-buffer. Wait-free SPSC ring buffer with cache-line padded counters and opposite-index caching; sub-50ns enqueue/dequeue on sibling cores.
Documentation
[package]
name = "subms-spsc-ring-buffer"
version = "0.5.2"
edition = "2024"
rust-version = "1.85"
authors = ["Kieran Smith <oss@submillisecond.com>"]
description = "submillisecond.com cookbook recipe - concurrency: subms-spsc-ring-buffer. Wait-free SPSC ring buffer with cache-line padded counters and opposite-index caching; sub-50ns enqueue/dequeue on sibling cores."
license = "MIT OR Apache-2.0"
readme = "README.md"
homepage = "https://submillisecond.com/cookbook/recipes/subms-spsc-ring-buffer"
keywords = ["spsc", "ring-buffer", "lock-free", "concurrency", "subms"]
categories = ["concurrency", "data-structures"]

[lib]
name = "subms_spsc_ring_buffer"
path = "src/lib.rs"

[[example]]
name = "perf_main"
required-features = ["harness"]

[[example]]
name = "perf_features"
required-features = ["harness", "bulk", "wait-strategies", "mpsc-fan-in", "mpmc-disruptor", "metrics"]

[features]
default = []

# Bench-harness wiring: `SubMsRecipe` impl + perf_main example.
harness = ["dep:subms"]

# ----- Opt-in feature catalog (subms 0.5+) -----
# Each feature lives in src/features/<name>.rs behind a #[cfg(feature)]
# gate. Base ring stays wait-free SPSC + zero-dep std-only; opt-ins add
# focused capabilities. Pick what you need:
#
#   subms-spsc-ring-buffer = { version = "0.5", features = ["bulk"] }
#   subms-spsc-ring-buffer = { version = "0.5", features = ["bulk", "wait-strategies"] }
#
# `bulk`            - try_enqueue_bulk / try_dequeue_bulk amortise the
#                     per-item atomic ops behind a single fence per call.
# `wait-strategies` - blocking wrappers around the base producer/consumer
#                     that take a wait strategy (BusySpin / Yield / Park).
# `mpsc-fan-in`     - N-producer 1-consumer demuxer over N independent
#                     SPSC rings. Each producer is still wait-free SPSC.
# `mpmc-disruptor`  - LMAX-Disruptor-style multi-producer multi-consumer
#                     ring with sequence barriers + CAS claim. Independent
#                     of the base SPSC structures.
# `metrics`         - per-instance counters: enqueue/dequeue success +
#                     fail, max depth, CAS retries (mpmc only).
bulk = []
wait-strategies = []
mpsc-fan-in = []
mpmc-disruptor = []
metrics = []

[dependencies]
subms = { version = "0.5.2", path = "../../../../subms/rust", optional = true }