4 ms·
I was hoping that Python threads split across processors, but it seems that they don't. Is there a language that does it "automagically" without having to expli
by bcater 19y ago
I was hoping that Python threads split across processors, but it seems that they don't. Is there a language that does it "automagically" without having to explicitly code it?
- deleted 19y ago[deleted]
- jsjenkins168 19y agoYour OS process scheduler should do it to some degree at runtime, but beyond that there is not a lot that can be achieved without explicitly handling synchronization and locking of shared resources. I know there are some startups working on parallel processing optimizations though, so there could be some new developments in the future. Google has been acquiring a few of these startups recently..
- cpinto 19y agoSee if the processing package is useful to you: http://pypi.python.org/pypi/processing http://pypi.python.org/pypi/processing
- jey 19y agoNo, the standard Python interpreter kind of sucks at this. You might want to look at Stackless Python though, it has all sorts of neat concurrency primitives. http://www.stackless.com http://www.stackless.com
- euccastro 19y agoStackless is great, but it doesn't help much with multiple processors.
- astrec 19y agoHave a look at Erlang. Actually, have a look at functional languages in general as being (mostly) side effect free they often have primitives for parallel processing. Another pretty exciting language you might to look at is F# - presently running under Mono on my macbook. Finally, if you love your python (who doesn't? ;)) - see http://www.parallelpython.com/ http://www.parallelpython.com/ for some interesting work.
- marcus 19y agoI love python and use it for many of my prototyping needs but if you really need that extra juice from your extra processors you are probably using the wrong language for the problem. From my experience average increase in speed gained from porting to C/C++ (even without using multi processors) is about x60-x100.
- nevinera 19y agounless your application is very unusual, you could've just ported your < 10 bottlenecks and made the same gain. (and x60? right..)
- icky 19y ago> I was hoping that Python threads split across processors, but it seems that they don't. Understanding concurrency in Python: They're called process-ors, not thread-ors... ;-)