“The C++ Execution Model”
summary
C++ defines an abstract machine of threads evaluating code in a flat storage space, not modeling caches or NUMA; memory_order_consume is ignored here. Rules: sequencing and indeterminate/unsequenced evaluation (function arguments become indeterminately sequenced in C++17), and the synchronizes with → happens before composition for cross-thread visibility. Forward-progress guarantees (concurrent, parallel, weak) drive deadlock behavior; practical examples show relaxed atomics causing UB, and a thread-pool join needs boost blocking to avoid starvation.
AI-written summary · about
chapters (18)
- 0:00Introduction to C++ Execution Model
- 1:50C++ Abstract Machine Basics
- 4:45Storage Model and Objects
- 7:20Threads and Execution
- 8:23Evaluating Expressions in C++
- 11:20Side Effects vs Value Computations
- 13:14Sequence Before Relation
- 14:40Indeterminately and Unsequenced Relations
- 15:50Interleaving Execution Steps
- 18:35Function Evaluation Rules
- 20:00Operator Evaluation Order
- 23:45Synchronizes With Relation
- 27:17Happens Before Relation
- 31:39Forward Progress in C++
- 33:51Blocking and Forward Progress
- 36:23Forward Progress Guarantees
- 45:26Key Takeaways from the Talk
- 46:09Q&A Session
related talks
42mThe C++ Execution Model
01h 28mC++ Memory Model: from C++11 to C++23
01h 01m“C++11/14/17 atomics and memory model..."
01h 02mThe Two Memory Models
01h 33mC++11 to C++23 in the C++ Memory Model
59mAn Introduction to Multithreading in C++20
01h 04mBack to Basics: Concurrency
53mAtomics, Locks, and Tasks (part 1 of 2)
