Using Asyncio in Python 3
summary
Demonstrates Asyncio and async/await on Python 3.7 with a concrete race condition: two threads incrementing and decrementing a counter over 40,000 increments shows nonzero result under threading but zero under asyncio. Builds a working restaurant simulator ported from threads to coroutines, removing locks and using tasks, futures, cancellation and timeouts. Measures overhead and scaling to 10,000 coroutines, highlights needing occasional yields for CPU work and when to run blocking code in executors.
AI-written summary · about
chapters (7)
- 0:00Start
- 3:47Pre-Emptive Multitasking
- 10:25Using async Io and Quarantines
- 14:31Usage Classic Hello World Example
- 28:08Restaurant Simulator
- 39:25Caches
- 42:18Swallowed Exceptions
related talks
01h 29mStandardised Coroutine Concurrency in Python 3
31mA Really Gentle Introduction to Asyncio
01h 21mTUTORIAL: Async Python, Good it is
01h 00mCoroutine Concurrency in Python 3 with asyncio
30m"Asyncio by Example"
24mA Crash Course in Python 3's asyncio
59mGet to grips with asyncio in Python 3
41mCoroutines, Async/Await, Asyncio and the Pulsar Library
