2 ms·
Getting rid of the GIL would make the 2 to 3 transition look like kindergarten. There's lots and lots of Python code (and C extensions) that makes assumptions e
by FartyMcFarter 7y ago
Getting rid of the GIL would make the 2 to 3 transition look like kindergarten. There's lots and lots of Python code (and C extensions) that makes assumptions enabled by the GIL.
For starters:
If you get rid of CPython's atomic operations on lists and other simple objects, lots of Python code would need more locks than it needs now.
If, on the other hand, you wish to keep those operations atomic, without the GIL that means introducing fine-grained locks on specific objects, which would worsen even single-threaded performance. Imagine taking a pthread mutex each time you append an item to every list or store a number in every variable.