Couple that with the fact that python on its own without packages isn't that useful and you can see why this is going to be a challenge .
Multiple interpreters in the same process with their own locks is happening now, though
Couple that with the fact that python on its own without packages isn't that useful and you can see why this is going to be a challenge .
Multiple interpreters in the same process with their own locks is happening now, though
If the GIL is removed and variables are no longer volatile (i.e, changes are no longer made visible immediately to other threads) that seems like it would break a lot of code. On the other hand, keeping every variable volatile seems like it would be terrible for performance.
Maybe I'm missing some critical difference between Python and the JVM here?
The smaller problem is this does at a small amount of overhead even to single-threaded performance. The gilectomy project improved performance elsewhere so net performance is close to the same.
The bigger problem would be integrating this strategy with all the libraries that rely on existing GIL behavior.
So make it a runtime option.
It's getting tiresome that python performance is suffering because some can't be bothered to write thread-safe software. In 2022.
Or else? It's not like they're not trying their best - or don't spend the level of effort that they and their companies are willing to take...
I don't find multithreading in languages without particular support easy at all, but I have become better at it. It is possible and sometimes necessary. It seems like the prevailing attitude in the Python ecosystem is weird, a kind of sour grapes thing, i.e. "Python doesn't have good multithreading support, but multithreading is ugly and error-prone anyway and the alternatives are almost as good or better".
The closest anyone has come to removing the GIL is the Gilectomy project by Larry Hastings, and it's unlikely to ever be upstreamed unless it could be somehow made to work with libraries that rely on assumptions about GIL mechanics (eg numpy).
It was Sam Gross and he more or less achieved it:
https://mail.python.org/archives/list/python-dev@python.org/...