Concurrency in Practice
Thread pools, async vs threads, the Python GIL and a cheat sheet.
4 notes · 19 min total
- 1Thread PoolsWhy servers reuse a fixed set of worker threads fed by a queue, and how to size the pool for CPU-bound and I/O-bound work.5 min
- 2Async vs MultithreadingHow an event loop and multiple threads each avoid wasted waiting, and which to choose for I/O-bound vs CPU-bound work.5 min
- 3Python GILWhat CPython's Global Interpreter Lock is, why it exists, why threads don't speed up CPU-bound Python, and how to work around it.5 min
- 4Concurrency Cheat SheetA one-page review of race conditions, locks, atomics, semaphores, deadlock, scheduling and async, with links to each lesson.4 min