D
D
Darsatan2014-10-05 15:09:40
Python
Darsatan, 2014-10-05 15:09:40

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

2 answer(s)
A
Alex Chistyakov, 2014-10-05
@Darsatan

Of course, the GIL is local to each process.
How could it be otherwise? Processes are by default unrelated.

R
radioxoma, 2014-10-06
@radioxoma

Yes, so you can use the multiprocessing module to use all the CPU cores..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question