~/talk

“C++ atomics, from basic to advanced. What do they really do?”

Talkat CppCon 2017 · 2017-09-24..09-29· [concurrency, c-and-cpp]
links:none on file
slides:none on file

Benchmarks show a mutex with a per-thread local accumulator outruns naive atomic increments: the “wait-free” atomic-plus-equals version runs slower and scales poorly on a 120-core Broadwell because cache-line bouncing and false sharing dominate. Sequentially-consistent atomic stores cost about 15x slower than relaxed stores on some paths; x86’s xadd is acquire-release so relax won’t help there. Alignment and padding decide is_lock_free depends on alignment, compare_exchange has compare_exchange_weak can spuriously fail and needs careful acquire/release ordering to publish non-atomic data safely.

AI-written summary · about

  1. 0:00Intro
  2. 1:15Demonstration
  3. 3:22General conclusion
  4. 4:22What is atomicity
  5. 5:13What is increment
  6. 6:26How does increment work
  7. 8:15How does atomics work
  8. 10:33Types of atomics
  9. 11:00Atomic operations
  10. 17:08Compare and swap
  11. 26:30Secrets
  12. 32:38Cache line
  13. 37:37Nonatomic operations
  14. 43:13Memory barriers
  15. 48:51Memory order
  16. 53:08Memory
~/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.