Live Lock-Free or Deadlock (Practical Lock-free Programming)
summary
Shows how to build a practical lock‑free producer/consumer system using compare‑and‑swap and atomic exchange, then measures when it actually wins versus a spin‑locked STL queue. Demonstrates a working design: an array of atomic pointers to single‑thread subqueues with atomic-exchange ownership, explains when enqueue can fail and how to recover, and reports that generic lock‑free queues often lose to simpler locked or hybrid approaches unless application assumptions reduce shared state.
AI-written summary · about
chapters (19)
- 0:00Introduction to lock-free queues
- 1:52Race conditions in lock-free queues
- 3:40Compare-and-swap atomic primitive
- 8:08Producer-consumer problem
- 12:25Lock-free vs lock-based programs
- 15:18Deadlocks and live locks
- 20:12Atomic operations vs locks
- 24:10Application vs library programming
- 29:11Consumer problem solution
- 31:42Performance limits of concurrency
- 37:42Data sharing overhead
- 40:32Shared variables in lock-free
- 42:44Thread-safe queue requirements
- 46:03Ordering guarantees in queues
- 50:26Weekly ordered queue design
- 1:01:14Double-checked locking pattern
- 1:13:23Performance tweaks for queues
- 1:22:24Single producer thread optimization
- 1:28:09Transactional memory support
related talks
01h 11mLock-Free Programming (or, Juggling Razor Blades), Part II
19mIntroduction to Lock/Wait Free Algorithms - Defining and Understanding the Terms
01h 32mLock-free programming with modern C++
01h 38mLock-free Programming is Dead - Long Live Lock-free Programming!
01h 03mSafety: off --- How not to shoot yourself in the foot with C++ atomics
01h 05mAn Interesting Lock-free Queue - Part 2 of N
01h 06mLocks are tricky — let's understand them by building one
53mAtomics, Locks, and Tasks (part 1 of 2)
