Does running separate python processes avoid the GIL?

后端 未结 2 1761
情深已故
情深已故 2021-01-03 22:59

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 para

2条回答
  •  情话喂你
    2021-01-03 23:53

    The GIL only affects threads within a single process. The multiprocessing module is in fact an alternative to threading that lets Python programs use multiple cores &c. Your scenario will easily allow use of multiple cores, too.

提交回复
热议问题