Why Should Async Get All The Love Advanced Control Flow With Threads
summary
Claim: threads match or beat async for throughput and work with existing frameworks like Flask and requests while async wins on memory for huge idle connection counts (threads ~10k each, async tasks ~2k). Shows concrete tools: concurrent.futures, ThreadPoolExecutor, executor.map, as_completed. Demonstrates a Paxos-style discovery service and a Flask server run on a background thread. Notes real limits: cancellation with threads is awkward (handmade cancellation token) and structured-concurrency semantics are not fully supported.
AI-written summary · about
chapters (12)
- 0:00Start
- 2:05Threads and Asyncio
- 2:16Not Parallelism
- 3:30Concurrency
- 7:10What Web Frameworks Do You Use?
- 7:49Threads vs Asyncio
- 10:51It's Time To Take Another Look At Threads
- 12:54Executors
- 14:18Workflows
- 19:37Cancellation
- 21:13Real Life Example
- 26:58Cool Threads
related talks
02h 57mPython Concurrency: from beginner to pro
35mWriting robust, readable, and maintainable concurrent programs in Python
50mUsing Asyncio in Python 3
27m"Python’s tale of concurrency"
56mLeveraging Async and Await in Modern Python
31mA Really Gentle Introduction to Asyncio
20mIt's Critical: Concurrent programming as a sane programming model
32mEnhancing AsyncIO for Complex Applications
