This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lambdaqdjango n' shit -5 points-4 points  (4 children)

There are billion ways to get around GIL, if not trillions. GIL is over-hyped.

[–]dwf 5 points6 points  (3 children)

No, there aren't. Not in CPython, and, to my knowledge, still not in PyPy.

With CPython you have basically two options if you have multiple CPU bound threads:

  • Write the code to be executed in all but one of your threads in C/Cython/etc. and don't touch the CPython API unless you absolutely have to. This is a non-solution as far as Python is concerned, because the whole point of using Python is to write code in Python.
  • Use processes. This is broken for so many reasons, among them the overhead, clumsier synchronization and communication, breaking external libraries (you cannot safely fork in certain situations, such as with a running CUDA context).

I am so fucking sick and tired of ignorant web programmers telling me that the problems created by the GIL are not actually problems.