PyCon Redux
GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

Asyncio and GIL

A brief review of Python parallelism:

  • A defining feature of Python is the global interpreter lock (GIL), a design decision that limits each Python process to at most one executing thread.
  • Prior to Python 3.12, parallelism can be accomplished via: multithreading (built-in threading), multiprocessing (built-in multiprocessing), coroutines (built-in asyncio), or distributed systems

Łukasz Langa gives a nice redux on combining asyncio.TaskGroups and multiprocessing.managers.SharedMemoryManager to work around the GIL in a data processing application.