Crossfire: High-performance lockless spsc/mpsc/mpmc channels for Rust
5 months ago
- #lockless-channels
- #async-rust
- #performance
- High-performance lockless channels (spsc/mpsc/mpmc) supporting async and blocking contexts.
- Based on crossbeam-queue for low-level operations.
- V1.0 released in 2022.12, V2.0 in 2025.6 with API refactoring, V2.1 in 2025.9 with performance improvements.
- Removed crossbeam-channel dependency in V2.1 for better performance.
- Provides detect_backoff_cfg() for performance optimization on single-core systems.
- Benchmark available via 'cargo bench --bench crossfire'.
- Stable on x86_64 and arm architectures with various runtimes (tokio, async-std, smol).
- Three modules: spsc, mpsc, mpmc, each with different channel types (blocking, async, mixed).
- Supports cancellation-safe operations in async contexts with clean state cleanup.
- Additional functions like send_timeout() and recv_timeout() when 'tokio' or 'async_std' features are enabled.
- Memory-efficient SP/SC API for completely lockless waker registration.
- Compatible with tokio-1.x and async-std-1.x, runtime-agnostic.