Threads Considered Harmful
summary
Argues that raw threads and locks are replaced by modeling work as concurrency graph of independent tasks, eliminating explicit mutexes; introduces concrete primitives like task serializers, read/write and N-serializers, and shows a lock-free scheduler design. Implements a prototype library Concord and reworks an H.264 decoder benchmark: the task-based version matches or slightly outperforms a pthreads implementation and approaches the ideal on a 6-core (12 HT) machine, while avoiding deadlocks and improving composability.
AI-written summary · about
chapters (36)
- 0:00Start
- 0:20Threads Considered Harmful
- 2:43structured programming
- 5:00problems with threads
- 5:40cost of locking
- 5:50synchronization
- 7:13locks do not scale
- 8:00adding a lot of threads
- 8:462 threads, 1 core
- 13:52example 2
- 14:45# threads = # cores
- 15:36composability
- 17:20threads & locks
- 17:56concurrency vs parallelism
- 18:42a single-threaded application
- 21:26a multi-threaded application
- 26:50general algorithm
- 28:08two key moments
- 28:42theoretical results
- 29:55high performance
- 32:55two threads with a mutex
- 34:24a better notation
- 34:57a task with restrictions
- 38:15implementation details
- 39:14task executors
- 39:53read-write mutexes
- 40:38same notation
- 43:28semaphores
- 44:03improving notation
- 44:19problem representation
- 47:41systematic way
- 48:17maximizing throughput
- 50:321. task systems are composable
- 53:282. decomposing tasks
- 54:29user account serializer
- 55:28task continuations
related talks
01h 08mBetter Code: Concurrency
01h 04mAtomics, Locks, and Tasks (part 2 of 2)
53mAtomics, Locks, and Tasks (part 1 of 2)
39mLet's talk concurrency
34mIntroduction and pitfalls of Java's new concurrency model
38mIntroduction and pitfalls of Java's new concurrency model
59mAn Introduction to Multithreading in C++20
45mIntroduction and pitfalls of virtual threads
