3 ms·
How does the GIL come into play here?
by bilsbie 1y ago
How does the GIL come into play here?
- punnerud 1y agoGIL is like a "red-cap" on the head for the CPU-core running the task, so you would not be able to run true Async without GIL. Have to hand the "red-cap" back, for the next task. Instead of using a global lock ("red-cap"), Python objects have introduced a specialized reference counting system that distinguishes between "local" references (owned by a single thread) and "shared" references (accessed by multiple threads). In that way enabling to remove GIL in the long run, now starting with making it optional.