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-inmultiprocessing), coroutines (built-inasyncio), 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.