~/talk

Atomic break down: understanding ordering

Talkat RustWeek 2025 · 2025-05-13..05-17· [rust, concurrency]
name:Ciara
links:none on file
slides:none on file

Demonstrates a concrete bug where a relaxed atomic flag on an ARM laptop lets a reader see the flag true before the accompanying data is visible, causing a failing assert when run in a loop. Shows the specific fix: use a release store on the writer and an acquire load on the reader so the data write release acquire synchronizes with the reader and guarantees visibility. Notes when relaxed ordering or sequential consistency are appropriate.

AI-written summary · about

  1. 0:00Introduction
  2. 1:50Memory ordering in atomics
  3. 5:24Single-threaded assumptions
  4. 7:50Reordering in multi-threaded code
  5. 10:56Caches and memory visibility
  6. 12:59C++20 vs Rust memory model
  7. 14:26Fixing with release-acquire
  8. 17:17When to use release-acquire
  9. 19:23RMW with acquire-release
  10. 20:25When release-acquire fails
  11. 22:30Sequentially consistent ordering
  12. 23:56When relaxed ordering works
  13. 25:41Mutexes and memory ordering
  14. 26:43Memory ordering choices
  15. 27:46Further reading
  16. 28:09Q&A: Performance vs correctness
  17. 30:16Q&A: Check data before flag
  18. 30:58Q&A: Guaranteed visibility with acquire
  19. 32:00Q&A: Debugging reordering
~/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.