[Python-ideas] Remove GIL with CAS instructions?
collinw at gmail.com
Tue Nov 24 20:21:05 CET 2009
On Tue, Nov 24, 2009 at 11:10 AM, Guido van Rossum <guido at python.org> wrote:
> Note that Greg Stein reached this same conclusion (and similar
> numbers) over 10 years ago...
It's worth repeating this kind of experiment; the hardware landscape
has changed a lot in 10 years. It's interesting that the results are
the same a decade later.
> On Tue, Nov 24, 2009 at 10:39 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> Ok, out of curiousity I gave it a try: replacing INCREF/DECREF with atomic
>> instructions (*) slows down the interpreter by 20 to 40% depending on the
>> workload. And keep in mind this is the tip of the iceberg: to remove the GIL
>> you'd also have to add fine-grained locking in other places (dicts etc.).
>> Which makes me agree with the commonly expressed opinion that CPython would
>> probably need to ditch refcounting (at least in the critical paths) if we want
>> to remove the GIL.
>> (*) using gcc's atomic primitives which, I have checked, are inlined as
>> carefully optimized assembler:
>> Python-ideas mailing list
>> Python-ideas at python.org
> --Guido van Rossum (python.org/~guido)
> Python-ideas mailing list
> Python-ideas at python.org
More information about the Python-ideas