A bounded MPMC queue and a named shared-memory channel for C11, C++17, Rust, and C# 15 / .NET 11.
| Queue | Bounded FIFO of 64-bit values. Any thread may push or pop; calls never block. |
| Channel | Same-machine, multi-process FIFO of fixed-size byte slots. Zero-copy receive; optional zero-copy send. |
| Build | Bazel. Cargo and the .NET SDK only package the published artifacts. |
| Proof | Lean checks the sequentially-consistent kernel core; CBMC checks selected C functions. This is not an end-to-end proof. |
#include "mpmc.h"
int main(void) {
mpmc_queue *q = mpmc_create(1024);
if (q == NULL) return 1;
mpmc_push(q, 42);
uint64_t value;
if (mpmc_pop(q, &value) && value == 42) {
mpmc_destroy(q);
return 0;
}
mpmc_destroy(q);
return 1;
}Build the snippet with the flags in Getting started. Verify the repository:
bazel test -c opt //...For the channel, the other bindings, and install steps, start with Getting started.
Linux x86-64, Linux arm64 (Clang), and macOS arm64. Windows and 32-bit targets are not supported. See Portability for compiler, atomic, and package details.
- Getting started
- Concepts: queue, shared memory, portability, verification boundary
- Bindings: C, C++, Rust, C#
- Examples: six runnable scenarios per language
- Operations: build, test, benchmark, verify, release
- Design: algorithm, proof, shared-memory, C# design, fluent consumers, cooperative disposition
The Lean development proves FIFO and linearizability for the sequentially-consistent kernel-event core. CBMC checks selected production C functions over their full input domains, plus bounded initializer and kernel checks. The printer, compiler and 16-byte atomic lowering, POSIX lifecycle, weak-memory refinement, the Rust FFI layer, the C# state machine, and progress are trusted or tested, not proved.
See the verification boundary for the exact claims.