Understanding Non-blocking IO
summary
Shows how Python sockets go non‑blocking with setblocking(False), how send returns a partial byte count when the kernel buffer fills, and how using select (or poll/epoll/kqueue) avoids a wasteful busy loop. Demonstrates a generator-based event loop that interleaves sending 70 MB (which blocks for ~45s in the blocking version) with a CPU task, maps fds to generators, and actually works as a simple cooperative scheduler; select scales poorly past ~4000 fds.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:26High Level Overview
- 1:24Some Background
- 2:58What is Blocking?
- 7:13Non-Blocking I/O
- 11:47Non-Blocking Network I/O in Python
- 18:41Understanding select()
related talks
25mThe hitchhiker's guide to asyncio
31mA Really Gentle Introduction to Asyncio
32mEnhancing AsyncIO for Complex Applications
20mIt's Critical: Concurrent programming as a sane programming model
35mHow Do Python Coroutines Work?
32mDemystifying AsyncIO: Building Your Own Event Loop in Python
31mThinking Outside the GIL with AsyncIO and Multiprocessing
59mGet to grips with asyncio in Python 3
