Abstract
- Prevents multiple threads from executing Python bytecode simultaneously
Ways to get around
- Disable GIL (optional in newer versions)
- Use multiprocessing (separate processes with their own GILs)
Multiprocessing vs. Multithreading
- Multithreading: Multiple threads share memory but limited by GIL
- Multiprocessing: Multiple processes with separate memory spaces and separate GILs. We can enable communication with Inter-Process Communication