The C++ Execution Model
summary
Reads the C++ standard and extracts concrete rules: a platform-agnostic flat global storage model, the as-if rule, and how threads evaluate function calls. Demonstrates sequencing vs. synchronizes-with vs. happens before, shows how atomic acquire/release or a semaphore creates a guaranteed ordering while relaxed atomics leave outcome indeterminate, and builds a thread-pool example that breaks with one worker and is fixed by boost-blocking wait that executes queued tasks until completion.
AI-written summary · about
chapters (14)
- 0:00C++ execution model intro
- 1:10Abstract machine concept
- 6:13Memory systems vs abstract machine
- 8:20Execution threads in C++
- 9:48Expressions and evaluation
- 12:39Sequenced-before in C++
- 17:00Function evaluation rules
- 20:31Synchronizes-with across threads
- 23:08Happens-before ordering
- 27:09Data races and UB
- 31:03Thread execution steps
- 33:36Forward progress guarantees
- 37:06Boost thread pool example
- 40:40Summary
related talks
56m“The C++ Execution Model”
04mC++ Execution Model In Five Minutes
01h 28mC++ Memory Model: from C++11 to C++23
50mC++ Parallel Programming Models
01h 02mThe Two Memory Models
59mAn Introduction to Multithreading in C++20
01h 33mC++11 to C++23 in the C++ Memory Model
01h 01mExecutors for C++ - A Long Story ...
