Python 3.2 ALPHA is out.
From the Change Log, it appears the GIL has been entirely rewritten.
A few questions:
UPDATE:
I'm fairly new to Python. So all of this is new to my but I do at least understand that the existence of a GIL with CPython is a huge deal.
Question though, why does CPython not just clone the interpreter like Perl does in an attempt to remove the need for the GIL?
You can't argue with the single-threaded performance benefits of the GIL. So the result is that Python 3 still has the GIL.
The GIL's low performance overhead really shines for single-threaded operations, including I/O-multiplexed programs where libraries like asyncio are used, and this is still a predominant use of Python.
This is achieved by preventing threads to use the Python interpreter simultaneously while they run. Use threaded extensions in C where GIL is not a problem (Numexpr, NumPy with MKL, SciPy with FFTW...): Pro: powerful and very easy to use.
GIL or Global Interpreter Lock Generally, Python uses a single thread to run a single process. We get the same performance result of the single-threaded and multi-threaded processes using the GIL. It restricts achieving multithreading in Python because it prevents the threads and works as a single thread.
The best explanation I've seen as to why the GIL sucks is here:
http://www.dabeaz.com/python/GIL.pdf
And the same guy has a presentation on the new GIL here:
http://www.dabeaz.com/python/NewGIL.pdf
If that's all that's been done it still sucks - just not as bad. Multiple threads will behave better. Multi-core will still do nothing for you with a single python app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With