CPython’s GIL allows only one thread to run Python bytecode at a time per process. Use asyncio for high-concurrency network I/O, threads (or asyncio.to_thread) for blocking I/O libraries, and multiprocessing/ProcessPoolExecutor for CPU-bound Python work. Never call blocking calls like time.sleep or requests inside an async coroutine.
Follow-up Interview Question · How does FastAPI run plain def endpoints without blocking the main event loop?