3 ms·
There’s a lot of deployed Python code that uses multithreading. The genie is out of the bottle, so to speak. The JavaScript model is, basically, the sub-interp
by klodolph 3y ago
There’s a lot of deployed Python code that uses multithreading. The genie is out of the bottle, so to speak.
The JavaScript model is, basically, the sub-interpreter model. You have multiple independent heaps. Given independent heaps, you write single-threaded code and don't worry about locking, because no other thread can modify objects in your heap anyway, outside of special objects like SharedArrayBuffer.
Maybe you could enable GIL-free, single-threaded, sub-interpreter Python as a compile-time option. But it would break such a large amount of code out there. It would be a very difficult transition, practically speaking.