← All terms · Async & concurrency
Event loop
Scheduler that drives async code — runs ready coroutines, parks blocked ones. `asyncio.run(main())` starts one.
Learn this interactively:
Open lesson sr-23 →Related — Async & concurrency
async defDeclares a coroutine. Can be awaited; runs cooperatively on an event loop.awaitPauses a coroutine until another coroutine/Future finishes. Only legal inside `a…GILGlobal Interpreter Lock — CPython's mutex that lets only one thread run Python b…asyncio.gatherRun multiple coroutines concurrently and wait for all of them. The bread-and-but…