3 ms·
I think this is so smart. The main thing holding back replacement of the GIL at the moment is that there is a VAST existing ecosystem of Python packages written
by simonw 4y ago
I think this is so smart. The main thing holding back replacement of the GIL at the moment is that there is a VAST existing ecosystem of Python packages written in C/etc that would likely break without it.
Multiple interpreters with their own GIL keep all of that existing code working without any changes, and mean we can run a Python program on more than one CPU at the same time.
- ehsankia 4y agoBut isn't this basically just nicer multiprocessing?
- cozzyd 4y agoIt's much nicer if you're using the C API...
- mixmastamyk 4y agoNo, they are in-process and able to access the same memory, although probably put behind a communication layer.
- rtpg 4y agoI do think that there’s been a lot of work around GIL removal, and every talk seems to end at the reality that the GIL allows for avoiding of a loooooot of locking structures and when removing the GIL you end up needing many granular locks.
- lazka 4y agoOnly C extensions that themselves have no global state and don't depend on the GIL for locking, which most of them do. So they will all require some porting, and it will take time since it requires newer CPython API only available in 3.9+ and some even 3.11+ (PEP 630).