Multi-threading on Multi-CPU machines

Aahz aahz at pythoncraft.com
Tue Jul 9 00:14:01 EDT 2002


In article <f0fd5987.0207080702.407100ec at posting.google.com>,
Garry Taylor <gtaylor at lowebroadway.com> wrote:
>
>I am attempting to make a multi-threading function in one of my
>programs in an effort to gain a speed increase, but I'm getting quite
>the opposite, even on a dual-CPU Intel/Linux box. Can anyone enlighten
>me as to why, my code is below:

Pure Python code will always slow down when threaded; in order to gain a
speedup, you must call an extension that releases the GIL.  All I/O
functions in Python release the GIL, for example.  For more info, see
the slides on my home page.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



More information about the Python-list mailing list