Wait-free synchronization primitives
Wait-freedom is the strongest non-blocking guarantee, ensuring that every thread completes its operations within a bounded number of steps. This library provides a collection of wait-free algorithms.
Usage
Add the following to your Cargo.toml:
[]
= " ... "
Triple Buffer
A wait-free triple buffer for single-producer, single-consumer scenarios.
use triple_buffer;
let = triple_buffer;
wr.write;
assert_eq!;
assert_eq!;
SPSC Queue
A wait-free single-producer, single-consumer queue.
use spsc;
let = spsc;
tx.try_send.unwrap;
assert_eq!;
Features
- No locks: All operations are wait-free.
- No dynamic allocation: All memory is allocated up front.
- Suitable for real-time systems: Progress is guaranteed for every thread.
License
Licensed under either of Apache License, Version 2.0 or MIT license
Roadmap
- Add nostd support
- Add MPSC/SPMC/MPMC queues