C++11 Multithreading done right?
summary
Shows concrete C++11 fixes and fails: demos of detached threads causing terminate versus using scoped_thread joins automatically; data races fixed by lock_guard/unique_lock and std::lock to avoid deadlock; singleton initialization solved with std::call_once or function‑static initialization; condition_variable pitfalls replaced by promise/future and async examples. Slides run broken code, wall‑clock sleeps to expose races, and working rewrites that compile and run; useful if wanting runnable patterns and debugging lessons, skip otherwise.
AI-written summary · about
chapters (22)
- 0:00C++11 multithreading intro
- 1:05Thread creation and lifecycle
- 3:10Scoped threads and joining
- 6:26Mutexes for shared resources
- 9:15Lock guards and RAII
- 10:59Deadlocks and mutex ordering
- 12:49Atomic locking with std::lock
- 15:26Thread-safe singleton patterns
- 18:38Double-checked locking pitfalls
- 21:30Singletons with call_once
- 22:53Meyer's singleton in C++11
- 23:37Thread-local storage
- 25:04Condition variables
- 31:12Producer-consumer with condition vars
- 35:09Promises vs condition variables
- 40:15Task parallelism with promises
- 42:49Simplifying with promises
- 46:31C++ memory model
- 47:35Atomic operations
- 51:34Acquire-release semantics
- 53:39Synchronizing non-atomics
- 57:11Q&A
related talks
01h 01mBack to Basics: C++ Concurrency
48mSecure C++ Programming
31mRace Conditions - Practical Tools & Techniques for Testing, Preventing, and Debugging C++/C Code
01h 02mModern C++ Safety and Security At 20
55mMemory Model: Get your shared data under control
01h 02mLock-free programming for real-time systems
54mThe Upcoming Concurrency TS Version 2 for Low-Latency and Lockless Synchronization
01h 06mSecurity Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design
