C++11 to C++23 in the C++ Memory Model
summary
Covers concrete differences from C++11 to C++23: shows compiled assembly on x86/ARM/RISC‑V to prove compilers and CPUs reorder code, demonstrates that volatile is not synchronization and is deprecated in C++20, and explains why consume is effectively unusable on most ISAs. Walks through practical builds: a spinlock using atomic exchange, a scheduler using std::jthread + stop_source, semaphore/latch/barrier examples, and a microbenchmark playground that shows pthreads, threads and jthreads have similar performance; recommends sanitizers that catch ~90% of multithread bugs.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 2:42Compiler optimizations
- 17:23CPU architecture
- 24:50Memory model basics
- 29:45Multi-threading challenges
- 35:10Volatile keyword
- 38:13Memory ordering and fences
- 1:02:20Practical C++ concurrency tools
related talks
01h 28mC++ Memory Model: from C++11 to C++23
01h 01m“C++11/14/17 atomics and memory model..."
01h 00mConcurrency Improvements in C++20: A Deep Dive
01h 02mThe Two Memory Models
01h 00mConcurrency in C++20: A Deep Dive
51mMemory Model: Get your shared data under control
38mWhat's New In C++23
43mC++ Atomics...
