Intro to Concurrent Programming 2/3: Modern Queues and Flat Combining
summary
Shows how to build a high-throughput queue using the unconditional Fetch-And-Add counter plus a tiny CAS path: claim slots via 64-bit fetch-and-adds, handle races by marking a poisoned cell and retrying, and emulate an infinite array with fixed-size Michael-Scott segments. The result is obstruction-free (not lock-free) yet fast in practice. Also demonstrates flat combining: a single combiner holds a simple mutex, batches published operations, and applies them sequentially to cut synchronization overhead.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:54Modern queues overview
- 5:18Fetch-and-add primitive
- 13:43Scalable queue design
- 24:43Obstruction-free queue
- 31:07Empty queue handling
- 41:20Infinite array emulation
- 47:25Flat combining intro
- 54:53Flat combining example
- 59:29Summary
- 1:00:36Q&A
related talks
01h 05mAn Interesting Lock-free Queue - Part 2 of N
01h 08mBetter Code: Concurrency
48m“Is Parallel Programming still hard? PART 2 of 2”
01h 35mThinking Outside the Synchronisation Quadrant
39mLet's talk concurrency
01h 07mBuilding Robust Inter-Process Queues in C++
30mCONQUERING CONCURRENCY WITH FUNCTIONAL PROGRAMMING
03h 29mConcurrency with Clojure
