Backend / README.md

Async and concurrency

Updated 1 min read index source
On this page5
  1. Foundations
  2. Asyncio
  3. Choosing a model, and offloading
  4. Coordination
  5. The 2026 headline

Async and concurrency

Top-three Python backend interview topic. Read in order — each file assumes the previous ones.

Foundations

# File Covers
01 The GIL, and free-threaded Python what the GIL is, why it exists, what it costs
02 Concurrency vs. Parallelism in Python Async Programming the distinction, and which Python tool gives you which
03 Difference Between Threads and Processes OS-level: address space, scheduling, cost
04 Context Switching in Python Async Programming what a switch actually costs, OS vs coroutine

Asyncio

# File Covers
05 Asynchronous Python and Coroutines async def, awaitables, how a coroutine runs
06 Event Loop Internals selectors, yield points, uvloop, Python vs JS loops
07 Asyncio vs Threads in Python: A Comprehensive Comparison the comparison, with hybrid patterns
12 TaskGroup and Structured Concurrency TaskGroup vs gather, and picking the right primitive
13 Cancellation, timeouts and error handling in asyncio CancelledError, asyncio.timeout, shield, ExceptionGroup
17 anyio and Trio — structured concurrency anyio/Trio, and why libraries target them

Choosing a model, and offloading

# File Covers
08 Python Concurrency Models: Processes, Threads, and Asyncio classifying the workload — the decision that drives everything
09 When to use processes when processes are the answer
14 run_in_executor and asyncio.to_thread asyncio.to_thread, executors, sync drivers in async code
15 Concurrent.futures in Python: A Comprehensive Guide the unified pool API
16 ProcessPoolExecutor in Python: A Comprehensive Guide process pools, pickling, IPC costs

Coordination

# File Covers
10 Synchronization Primitives in Python locks, semaphores, events, conditions — across all three models
11 Comparing asyncio.Queue and threading.Queue in Python queues, backpressure, and not mixing the two

Runnable examples: _examples/.

The 2026 headline

Free-threaded CPython is officially supported as of Python 3.14 (PEP 779) - no longer experimental, though still an opt-in build. Python 3.14 also added stdlib subinterpreters (PEP 734), so “threads, async, or processes?” is now a four-way question. Covered in The GIL, and free-threaded Python.

Contents 17