Does running separate python processes avoid the GIL?

后端 未结 2 1756
情深已故
情深已故 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:51

    As Alex Martelli points out you can indeed avoid the GIL by running multiple processes, I just want to add and point out that the GIL is a limitation of the implementation (CPython) and not of Python in general, it's possible to implement Python without this limitation. Stackless Python comes to mind.

提交回复
热议问题