Progress on the Gilectomy

Serhiy Storchaka storchaka at gmail.com
Sun Jun 11 01:11:34 EDT 2017


10.06.17 15:54, Steve D'Aprano пише:
> Larry Hastings is working on removing the GIL from CPython:
> 
> https://lwn.net/Articles/723949/
> 
> 
> For those who don't know the background:
> 
> - The GIL (Global Interpreter Lock) is used to ensure that only one piece of
> code can update references to an object at a time.
> 
> - The downside of the GIL is that CPython cannot take advantage of multiple CPU
> cores effectively. Hence multi-threaded code is not as fast as it could be.
> 
> - Past attempts to remove the GIL caused unacceptable slow-downs for
> single-threaded programs and code run on single-core CPUs.
> 
> - And also failed to show the expected performance gains for multi-threaded
> programs on multi-core CPUs. (There was some gain, but not much.)
> 
> 
> Thanks Larry for your experiments on this!

And also GIL is used for guaranteeing atomicity of many operations and 
consistencity of internal structures without using additional locks. 
Many parts of the core and the stdlib would just not work correctly in 
multithread environment without GIL.




More information about the Python-list mailing list