ptab
Lock-free concurrent table optimized for read-heavy workloads.
Inspired by the Erlang/OTP BEAM process table, ptab provides a fixed-capacity table where lookup operations perform no shared memory writes - not even reference counts. This enables linear read scalability with CPU count.
Usage
Add the following to your Cargo.toml:
[]
= "0.1"
Example
let table: PTab = new;
let index: Detached = table.insert.unwrap;
assert_eq!;
assert!;
assert_eq!;
Design
See IMPLEMENTATION.md for details.
- Zero-contention reads: Lookups use only thread-local state and atomic loads
- Cache-line aware: Consecutive allocations distributed across cache lines
- Generational indices: Slot reuse produces different indices (ABA prevention)
- Epoch-based reclamation: Safe memory management via
sdd