The GIL is hiding all kinds of concurrency bugs. If the CPython team default disable it then all hell is going to break loose.
It's better to carve out special concurrency constructs for those that need it.
The GIL is hiding all kinds of concurrency bugs. If the CPython team default disable it then all hell is going to break loose.
It's better to carve out special concurrency constructs for those that need it.
As an early python programmer, I copy pasted these types of answers. My old threaded code absolutely has these bugs. I’ve even seen code in production that has these bugs, because they’re sometimes dumb performance enhancements, rather than bugs, unless you happen to use a Python interpreter without a GIL, especially one that that doesn’t exist yet.
Great care would have to be taken to make sure the GIL was not disabled by default, for anything an existing thread touches (or some super, dynamic aware, smarts to know if it can be disabled).
https://peps.python.org/pep-0703/#container-thread-safety
That's why gilectomy carries an unreasonable single-threaded performance cost: many operations now need to take a lock where before they relied on the GIL.
> I’ve even seen code in production that has these bugs, because they’re sometimes dumb performance enhancements, rather than bugs, unless you happen to use a Python interpreter without a GIL, especially one that that doesn’t exist yet.