3 ms·
There are many ways to get around the GIL. Use PyPy. Use processes. And are you really doing that much computation? Threads on standard CPython are perfectly fi
by msellout 11y ago
There are many ways to get around the GIL. Use PyPy. Use processes. And are you really doing that much computation? Threads on standard CPython are perfectly fine for I/O.
- actsasbuffoon 11y agoPyPy still has a GIL: http://pypy.readthedocs.org/en/latest/faq.html#does-pypy-have-a-gil-why http://pypy.readthedocs.org/en/latest/faq.html#does-pypy-hav...
- msellout 11y agoDoh. I should have said, "Use Jython."
- blt 11y agoYes, I really am doing that much computation. Not everyone works on database-dependent web apps. The GIL sucks. It holds Python back from wider use. I wanted to use Python for the GUI/scripting layer of a high performance desktop application, but dealing with the GIL in a mixed C++/Python multithreaded event-driven architecture was too annoying. When Python code isn't in charge of the main application loop, things get ugly. These days, I mainly see Python as a source of syntax inspiration for other languages. I say this with the highest amount of respect. I think Python's best qualities - list comprehensions, generators, itertools - are largely independent of its interpreted, dynamic nature. They will eventually find a better home in a language with more industrial-grade semantics. "The GIL isn't that bad, get over it" is not an attitude that will sustain a language for decades.