2 ms·
They're completely different goals. Yeah in theory multithreaded python lets you speed up certain programs... but the way in which it does so is important. Wit
by alfalfasprout 3y ago
They're completely different goals. Yeah in theory multithreaded python lets you speed up certain programs... but the way in which it does so is important.
With nogil python you can effectively have multiple threads that eg; call out to C code while having shared state accessible as python objects. This is pretty key for ML-- in fact this current incarnation of the PEP came from the PyTorch team.
Single threaded performance is important too but there have already been lots of decent workarounds for critical sections (eg; numba, Cython, and now things like Mojo).
The ordering is important too-- a lot of the faster cpython work would be thrown away completely if nogil came about. So the teams have had to coordinate.
In the ideal world that means both nogil mode + improvements to single threaded performance (Guido even hinted sophisticated JITing is being considered).