Concurrent Programming in C++
summary
C++11 concurrency features get practical coverage: std::thread plus hardware_concurrency=8 (hyperthreading can mislead), join vs detach (detached threads become daemons), and a concrete race example where 20,000 increments/decrements produce nonzero results until protected by a mutex. Shows RAII for threads, recommends lock_guard and unique_lock/std::lock to avoid deadlock, explains call_once, condition_variable, futures/async (deferred runs on caller), packaged_task and promise for exception-safe, civilized thread-to-thread communication.
AI-written summary · about
chapters (15)
- 0:00Intro
- 1:30Platform Neutral
- 8:52Creating Thread
- 17:08joining
- 19:20Thread Argument Gotcha
- 20:03Concurrency & Mutability
- 23:39Avoiding Race Condition
- 27:02Avoiding Deadlock
- 29:46Fixing Deadlock
- 30:56Multiple Locks
- 32:23Another Race Condition
- 40:28async launch options
- 42:36Future & Thread Safety
- 44:50What's really doing on?
- 45:46Using Promise
related talks
59mAn Introduction to Multithreading in C++20
01h 24mConcurrency in C++20 and Beyond
01h 04mBack to Basics: Concurrency
01h 08mBetter Code: Concurrency
01h 28mAn Introduction to Multithreading in C++20
50mC++ Parallel Programming Models
01h 04mConcurrency in C++20 and Beyond
01h 04mAtomics, Locks, and Tasks (part 2 of 2)
