Abstract


  • Prevents multiple threads from executing Python bytecode simultaneously

Ways to get around

  1. Disable GIL (optional in newer versions)
  2. 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