~/talk

Beyond Sequential Consistency - Leveraging Atomics for Fun & Profit

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [c-and-cpp, concurrency]
links:none on file
slides:none on file

C++ atomics are measured end-to-end on a lock‑free ring buffer: default sequentially consistent code hits about 10M ops/s on an Intel Xeon, switching to explicit acquire/release removes the locked fetch_add and jumps to 170M ops/s, adding cacheline alignment raises it to ~220M, and a cached‑index trick yields nearly a 3x further speedup (hundreds of millions ops/s). x86’s strong coherence makes acquire/release effectively free, while ARM requires explicit fences, observed via Compiler Explorer disassembly and benchmarks (slides on GitHub).

AI-written summary · about

  1. 0:00Introduction
  2. 0:31Talk overview
  3. 1:35Concepts and data structure
  4. 2:35Disclaimers and correctness
  5. 4:42What is lock-free programming
  6. 5:55Atomic operations example
  7. 9:16C++ memory model overview
  8. 10:42SMP machine architecture
  9. 12:46Memory fences and barriers
  10. 15:52Sequential consistency
  11. 19:14Acquire release semantics
  12. 23:17Relaxed memory ordering
  13. 27:28Lock free ring buffer design
  14. 30:42Prototypical queue implementation
  15. 35:28Naive queue performance
  16. 38:12Optimizing memory ordering
  17. 40:35False sharing and alignment
  18. 42:30Performance benchmarking results
  19. 45:12Large data size performance
  20. 47:10Multi-consumer broadcast queue
  21. 52:20Collector thread implementation
  22. 55:45Stood atomic necessity
  23. 58:25Platform differences ARM vs x86
  24. 1:00:24The necessity of fences
  25. 1:02:16More performance surprises
  26. 1:04:51Final optimization cached indexes
  27. 1:07:34Real world application challenges
  28. 1:11:10Cache optimization results
  29. 1:16:25Final caveats and conclusions
~/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.