asyncio runs many I/O-bound tasks concurrently on a single thread. While one task waits for the network or disk, others run. Building blocks Concept Code Coroutine async def fetch(): … Wait for it await fetch() Run concurrently await asyncio.gather(a(), b()) Structured concurrency (3.11) async with asyncio.TaskGroup() as tg: tg.createtask(…) Timeout async with asyncio.timeout(2): (3.11) Limit concurrency asyncio.Semaphore(5) Entry point asyncio.run(main()) When to use what Workload Tool Many network/disk waits asyncio (with async libraries like httpx, asyncpg) Blocking I/O libraries concurrent.futures.ThreadPoolExecutor / asyncio.tothread CPU-heavy computation multiprocessing / ProcessPoolExecutor Never call blocking functions such as time.sleep or requests.get inside a coroutine — they…