"Python’s tale of concurrency"
summary
A concrete comparison shows a comic-fetcher first running sequentially in ~1.84s, then sped up with OS threads for I/O, and finally moved to asyncio; a naive await-per-request version stays slow until each request is wrapped as asyncio.create_task and awaited together with asyncio.gather, after which concurrent fetches complete much faster. Uses an async HTTP client (httpx AsyncClient), notes uvloop as a faster event loop option and warns asyncio isn’t a universal silver bullet.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:21Python's Tale of Concurrency
- 1:29Introduction
- 4:16Concurrency Is Different from Parallelism
- 4:42How Python Handles Concurrency
- 7:51Execution Diagram
- 10:34Join the Threads
- 13:32Multitasking
- 17:21The Event Loop
- 18:13Pi Puppeteer
- 23:47Resources
related talks
56mLeveraging Async and Await in Modern Python
32mDemystifying AsyncIO: Building Your Own Event Loop in Python
25mThe hitchhiker's guide to asyncio
37mCommon asynchronous patterns in Python
35mHow Do Python Coroutines Work?
29mParallelism Shootout: threads vs asyncio vs multiple processes
30mLet's get you started with asynchronous programming
35mWriting robust, readable, and maintainable concurrent programs in Python
