“Multithreading is the answer. What is the question? (part 1 of 2)”
summary
Explains concrete multithreading patterns: use of std::future/std::promise as ticket pairs, moving ownership with unique_ptr to avoid shared state, and passing work via a thread-safe queue (with work-stealing) to reduce locks. Shows when threads help (CPU-bound, stream stages, large read-only datasets) and when careful optimization removed threading entirely (a streaming server saturates the network at 12% of one core). Mentions libGuarded, RCU-based containers and CsSignal as tools used to prevent deadlocks and reduce synchronization.
AI-written summary · about
chapters (41)
- 0:00Intro
- 0:14Agenda
- 0:52Multithreading is complicated
- 2:05Theres your first mistake
- 2:53Multithreading is the answer
- 3:21Multithreading
- 4:18Multitasking
- 4:36Quiz
- 5:49Thread vs Process
- 6:32Cores
- 7:02More cores doesnt mean faster
- 8:11Race conditions
- 9:12Stack
- 9:24Fiber
- 9:51Green Threads
- 10:42Multithreading in your toolbox
- 11:22Multithreaded solutions
- 13:53Real life example
- 15:05Generic multithreading environment
- 15:47Restaurant kitchen example
- 16:35Threading library
- 17:42Chefs might work at different speeds
- 18:22Lets make 50 apple pies
- 18:46Problems with this design
- 21:46deadlock
- 28:37Complex commercial kitchen
- 30:53Real kitchen
- 31:58Setting up resources
- 32:40Eating food
- 34:22Unique pointers
- 36:07Future Promise
- 37:35WorkStealing
- 38:43Locking
- 39:08Miscellaneous advice
- 42:01Readonly data
- 43:23Shared writable data
- 43:41Summary
- 44:05Subscribe
- 44:33CopperSpice
- 45:18Diamond
- 45:44Comments observations
related talks
59mAn Introduction to Multithreading in C++20
01h 28mAn Introduction to Multithreading in C++20
01h 08mBetter Code: Concurrency
58mMultithreading with Qt
01h 04mBack to Basics: Concurrency
01h 04mAtomics, Locks, and Tasks (part 2 of 2)
01h 00mCreating multithreaded applications with Qt
47mConcurrent Programming in C++
