4 ms·
They should consider copying OCaml's solution to the GIL: sets of one or more threads ("domains"), each set with its own global lock. So old code spawns thread
by debugnik 3y ago
They should consider copying OCaml's solution to the GIL: sets of one or more threads ("domains"), each set with its own global lock.
So old code spawns threads on the current domain, behaving as before, but new code can spawn new domains instead for proper concurrency. This lets you contain GIL-dependent threads while progressively migrating away from the GIL.
- jononor 3y agoPEP 684 – A Per-Interpreter GIL https://peps.python.org/pep-0684/ https://peps.python.org/pep-0684/
- debugnik 3y agoThis is a good and necessary step in the right direction, but if I understand correctly interpreters can't share memory directly. So this will unblock some uses cases for embedding Python and for replacing process-level parallelism, but it doesn't yet improve their existing threading model. Nice to know anyway, I'll keep an eye on how they progress.