4 ms·
That only works in some cases, if the boundary between Python and native code is absolute. In many cases users want to extend/configure the behavior of that nat
by cpgxiii 3y ago
That only works in some cases, if the boundary between Python and native code is absolute. In many cases users want to extend/configure the behavior of that native code, e.g. through callbacks or subclassing, and the GIL makes the behavior prohibitively slow (needing to lock/unlock to serialize at any of these potential Python<->native boundaries) or unsafe (deadlocks/corruption if the GIL isn't handled).
There's a lot of C++ code bound in python (e.g. via pybind11) where the GIL currently imposes a hard bound on how users can employ parallelism, even in "nominally" native code.