Tag view

#concurrency

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with concurrency

3 cards

Python Medium Theory

GIL basics

The GIL lets only one Python thread execute Python bytecode at a time in CPython.

  • Affects CPU-bound threads
  • I O waits still benefit
  • Use multiprocessing for CPU-heavy work

GIL basics

Python Hard Theory

Threading, multiprocessing, asyncio, coroutines, `async`/`await`, the GIL, and concurrency vs parallelism

Threads are useful for I/O-bound concurrency, multiprocessing is better for CPU-bound parallel work in CPython, and `asyncio` organizes cooperative I/O with coroutines and `async`/`await`.

  • GIL limits parallel bytecode execution in threads
  • Asyncio is concurrency, not magic parallelism
  • Choose the model based on the workload

Threading, multiprocessing, asyncio, coroutines, `async`/`await`, the GIL, and concurrency vs parallelism

FastAPI Medium Theory

async and await in FastAPI

Use async endpoints when the work awaits non-blocking I O; sync endpoints are fine for CPU work or blocking libraries.

  • Async improves concurrency for waits
  • Do not block the event loop
  • Choose library support carefully

async and await in FastAPI