Parallel computation

suggest change

Remarks

Because of the GIL (global interpreter lock), only one thread executes Python bytecode at a time in a process. So in general, using multi-threading only improves IO-bound computations, not CPU-bound ones. The multiprocessing module is recommended if you wish to parallelise CPU-bound tasks. CPython 3.13 and later also offer an optional free-threaded build without the GIL.

GIL applies to CPython, the most popular implementation of Python, as well as PyPy. Other implementations such as Jython and IronPython have no GIL.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents