Answer the question
In order to leave comments, you need to log in
Is the GIL local to every Python process?
Let's say there are 2 programs that, after launching, launch a new thread to process some data in the background. As a result, there are 2 Python processes with 2 running threads in each (main + data_processing).
Will each process have its own local GIL, or will it be the same for all pythons? Those. trying to capture gil will be 4 threads, or will the contention be "in-process"?
Answer the question
In order to leave comments, you need to log in
Of course, the GIL is local to each process.
How could it be otherwise? Processes are by default unrelated.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question