Parallel Python

Laszlo Nagy gandalf at designaproduct.biz
Mon Jan 8 04:36:29 EST 2007


parallelpython at gmail.com wrote:
> Has anybody tried to run parallel python applications?
> It appears that if your application is computation-bound using 'thread'
> or 'threading' modules will not get you any speedup. That is because
> python interpreter uses GIL(Global Interpreter Lock) for internal
> bookkeeping. The later allows only one python byte-code instruction to
> be executed at a time even if you have a multiprocessor computer.
> To overcome this limitation, I've created ppsmp module:
> http://www.parallelpython.com
> It provides an easy way to run parallel python applications on smp
> computers.
> I would appreciate any comments/suggestions regarding it.
>   
I always thought that if you use multiple processes (e.g. os.fork) then 
Python can take advantage of multiple processors. I think the GIL locks 
one processor only. The problem is that one interpreted can be run on 
one processor only. Am I not right? Is your ppm module runs the same 
interpreter on multiple processors? That would be very interesting, and 
something new.


Or does it start multiple interpreters? Another way to do this is to 
start multiple processes and let them communicate through IPC or a local 
network.


  Laszlo




More information about the Python-list mailing list