What is the Python GIL?

Python basics · Freshers and experienced

Model answer

The Global Interpreter Lock in CPython lets only one thread run Python bytecode at a time, so threads do not speed up CPU-bound pure Python code. Threads still help with I/O-bound work, and multiprocessing uses separate processes for CPU work. Recent Python versions include an optional free-threaded build, but check the current docs for its status.

Learn this topic

What Is Python? Install It and Write Your First Program in the course Python for Beginners: Learn to Code with Real Projects.

Sign in to add your own answer.

More questions