~/talk

Single Producer Single Consumer Lock-free FIFO From the Ground Up

Talkat CppCon 2023 · on Thursday, 2023-10-05· at 14:00· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard· [security]
links:none on file
slides:none on file

Builds a real Single‑Producer Single‑Consumer lock‑free wait‑free FIFO from first principles, with code on GitHub, using atomic 64‑bit cursors and then replacing sequentially‑consistent ops with relaxed acquire/release ordering and per‑cursor padding (std::hardware_destructive_interference_size) to eliminate false sharing. Adds a proxy pusher to halve memcpy and compares against Boost.Lockfree and Rigtorp variants. Reports measured throughput jumps: ~12–13M → ~50M → ~165M ops/s depending on atomics, indexing (mod vs power‑of‑two) and padding; unit tests and ThreadSanitizer confirm correctness.

AI-written summary · about

  1. 0:00Introduction
  2. 2:12Why build custom lock-free FIFO
  3. 5:03SPSC FIFO basics
  4. 10:04FIFO class structure
  5. 13:15Push and pop operations
  6. 16:31Debugging data races
  7. 20:25Fixing data races with atomics
  8. 26:48Testing and performance
  9. 27:34Optimizing with relaxed atomics
  10. 34:18Caching cursors for speed
  11. 37:30Reducing copies with smart pointers
  12. 46:11Benchmarks and comparisons
  13. 50:46Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.