I’m curious in how the Global Interpreter Lock in python actually works. If I have a c++ application launch four separate instances of a python script will they run in parallel on separate cores, or does the GIL go even deeper then just the single process that was launched and control all python process’s regardless of the process that spawned it?
Share
The GIL only affects threads within a single process. The
multiprocessingmodule is in fact an alternative tothreadingthat lets Python programs use multiple cores &c. Your scenario will easily allow use of multiple cores, too.