Expand description
§DualCache-FF (Fast and Furious)
A highly opinionated, absolutely wait-free concurrent cache in Rust, optimized for extreme
read-to-write ratios and scan-resistance. Built for high-performance and no_std embedded
target environments.
§🧠Key Concepts & Features
- Wait-Free Read Path & QSBR: All reads are completely non-blocking and wait-free. Memory reclamation is handled via Quiet State Based Reclamation (QSBR), allowing readers to instantly access cached nodes without locks, mutexes, or atomic reference counting overhead.
- Three-Tier Promotion System:
- T1 (Hot Cache): A high-speed
AtomicPtrslot array mapping to Cache indices for instant lookup. - T2 (Secondary Filter): A larger slot array for capturing secondary heat patterns.
- Cache (Main Storage): The source of truth using an open-addressed index (Linear Probing).
- T1 (Hot Cache): A high-speed
- Asynchronous Daemon & Batched Telemetry: Cache admissions and evictions are handled
exclusively by an asynchronous background daemon. Read/write telemetry is buffered locally
in Thread-Local Storage (TLS) and periodically flushed to the daemon via a custom lock-free
LossyQueue. - Avg-based Clock Eviction: A revolution-shielded circular clock evicts items whose access rank falls below the global average, instantly adapting to shifting workload heat distributions.
no_std/ Bare-Metal Fallback: Out-of-the-box support for resource-constrained environments viaStaticDualCache, using atomic spinlocks to eliminate background threads and achieve zero idle power.
Structs§
- Cache
Padded - Cache-line-aligned wrapper to prevent false sharing between worker slots.
Uses
#[repr(C, align(N))]directly: - Config
- Daemon
- Default
Spawner - Default
Tls - Dual
CacheFF - Static
Dual Cache - A synchronous, wait-free read / spin-locked write cache interface.
Serves as the standard
no_stdfallback when background Daemon processing is undesirable. - Worker
State - Per-worker QSBR state — cache-line padded to prevent false sharing between workers checking in/out simultaneously.