~/talk

The two memory models

Talkat Meeting C++ 2025 · 2025-11-06..11-08· [rust]
slides:none on file

Clear, actionable comparison of the C++ memory model and CPU memory models with concrete examples: a producer/consumer ready flag example that shows why atomics need release/acquire (or seq_cst) to establish happens‑before, and why relaxed atomics look identical in assembly yet produce UB on relaxed architectures; demonstration uses GCC 15.1 -O3 assembly demo and contrasts x86’s TSO (stores not reordered before loads) with RISC‑V/ARM’s more relaxed rules requiring fences, and shows the exact places the compiler must insert fences.

AI-written summary · about

  1. 0:00C++ memory models intro
  2. 1:03Why study two models
  3. 7:18Single-thread ordering
  4. 18:51Multi-threaded data races
  5. 23:48Happens-before in C++
  6. 28:27Atomic operations and orders
  7. 37:01CPU reordering effects
  8. 42:56Sequentially vs relaxed CPU
  9. 49:17Relaxed models like RISC-V
  10. 55:13Language vs CPU differences
  11. 56:17Q&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.