Memory Model: Get your shared data under control
summary
Explains the C++ memory model with concrete effects: compilers and CPUs reorder stores and reads, store buffers delay visibility, and sharing kills performance; demonstrates synchronization primitives that actually stop reordering — mutexes and atomics, lock_guard/unique_lock/shared locks, barrier, semaphore, condition_variable — and shows atomic operations like compare_exchange_weak/strong and atomic_ref. Uses hiking/ticket/lunch examples to build runnable patterns, shows what avoids deadlocks and what still surprises (two consecutive atomics are not atomic together).
AI-written summary · about
chapters (13)
- 0:00Memory model importance
- 2:29Concurrency with Heda and Dan
- 10:02Code reordering effects
- 13:11Synchronization rules
- 17:49Ledge synchronization
- 19:17Mutexes for critical sections
- 23:11Barriers for group sync
- 26:45Semaphores for access control
- 29:41Condition variables with mutexes
- 32:11Atomic operations
- 43:46Atomic types summary
- 45:11Key takeaways
- 46:17Q&A
related talks
01h 04mThe C++ Memory Model
01h 10mJava Memory Model (JMM) for Beginners and Advanced Users
01h 33mThe Foundation of C++ Atomics: The Knowledge You Need to Correctly Use C++ Atomics
01h 01mBack to Basics: C++ Concurrency
01h 06mSecurity Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design
01h 01mSmarter Cpp Atomic Smart Pointers - Efficient Concurrent Memory Management
01h 02mLock-free programming for real-time systems
44mDebugging memory corruptions in C++
