3 ms·
OK, sure, they run concurrently, but they can't be in the interpreter at the same time. The result is that using python threads to do python things, you won't u
by Nursie 14y ago
OK, sure, they run concurrently, but they can't be in the interpreter at the same time. The result is that using python threads to do python things, you won't utilise more than one core, most of the time.
There are a myriad of ways around it, but it is another thing you need to take into account when writing python programs or deciding to use python for a project.
- d0mine 14y agoyes, writing efficient programs is different in different languages. "- Don't write Java (or C++, or Javascript, ...) in Python." and then you don't need to search for workarounds.
- Dylan16807 14y agoSo if someone writes code that makes heavy use of nonlibrary python code in multiple threads, you're automatically going to blame them as writing in the style of some other language? That's pretty No True Scotsman. I'm not arguing for or against the GIL here but it's something to keep in mind. "Threads run concurrently" is misleading. And it's not a matter of being pythonic, the GIL isn't even a python feature.
- Nursie 14y agoWhat I'm saying is that it's a misleading language feature and something to bear in mind. It's not really a case of just being pythonic.