~/talk

“No Sane Compiler Would Optimize Atomics"

Talkat CppCon 2016 · 2016-09-18..09-23· [c-and-cpp, concurrency]
github:jfbastien
slides:none on file

Claim: compilers already optimize atomics and do architecture-specific lowering. Examples: x86 maps atomic loads to MOV and stores to LOCK-prefixed ops while ARM/MIPS use load‑linked/store‑conditional and RISC‑V offers LD/ACQ ST/REL; fences cost roughly 2–200 cycles. Compilers fold paired increments into a single +2, replace load+store with xchg, and can transform RMW+check sequences, but speculative loop hoisting once caused a correctness bug. A backend patch speeds a Hogwild‑style workload but also introduced a regressions later fixed.

AI-written summary · about

  1. 0:00Introduction to atomics
  2. 1:50Memory model review
  3. 2:18Hardware and architectures
  4. 35:27The consume problem
  5. 35:50Optimizing atomic code
  6. 44:11Advanced atomic topics
  7. 53:39Conclusion and takeaways
~/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.