External locking for internally synchronized data structures
summary
Proposes a Rust API for XArray that lets an external lock token permit the XArray to momentarily drop locks to perform allocations, avoiding C-only tricks like reservation API or holding outer spinlocks. Demonstrates a prototype (Rust userland XArray toy, patches for entry array and allocation buffer on the mailing list), explains races that force entry API retry paths when an insert drops and re-acquires locks, and compares pre-allocation vs slab-based pooling; prototype works but has ergonomic and correctness tradeoffs.
AI-written summary · about
chapters (8)
- 0:00Introduction and context
- 2:47Problems with external locking
- 7:26Pre-allocation and slab allocator
- 11:59Potential solutions and trade-offs
- 14:45Future work and compaction
- 16:58Finding locks for nodes
- 18:00Rust safety and mutex concerns
- 19:03Conclusion and Q&A
related talks
23mA Verified Thread-Safe Array in Rust
39mRust Atomics in the Wild: Memory Ordering Design Patterns [...]
01h 00mLock-Free Programming (or, Juggling Razor Blades), Part I
40mAdvanced Rust Programming Techniques
01h 02mA Lock-Free Atomic Shared Pointer in Modern Cpp
45mRust: safe and concurrent. But how does it do it?
01h 05mKeynote - Rust: confident, productive systems programming
15mNon-binary Rust: Between Safe and Unsafe
