dual processor

Jeremy Jones zanesdad at bellsouth.net
Sun Sep 4 16:03:23 EDT 2005


John Brawley wrote:

>Greetings, all.
>I have a program I'm trying to speed up by putting it on a new machine.
>The new machine is a Compaq W6000 2.0 GHz workstation with dual XEON
>processors.
>I've gained about 7x speed over my old machine, which was a 300 MHz AMD
>K6II, but I think there ought to be an even greater speed gain due to the
>two XEONs.
>However, the thought occurs that Python (2.4.1) may not have the ability to
>take advantage of the dual processors, so my question:
>Does it?
>  
>
Sure, but you have to write the program to do it.  One Python process 
will only saturate one CPU (at a time) because of the GIL (global 
interpreter lock).  If you can break up your problem into smaller 
pieces, you can do something like start multiple processes to crunch the 
data and use shared memory (which I haven't tinkered with...yet) to pass 
data around between processes.  Or an idea I've been tinkering with 
lately is to use a BSD DB between processes as a queue just like 
Queue.Queue in the standard library does between threads.  Or you could 
use Pyro between processes.  Or CORBA. 

>If not, who knows where there might be info from people trying to make
>Python run 64-bit, on multiple processors?
>Thanks!
>
>John Brawley
>
>
>--
>peace
>JB
>jgbrawley at charter.net
>http://tetrahedraverse.com
>NOTE! Charter is not blocking viruses,
>Therefore NO ATTACHMENTS, please;
>They will not be downloaded from the Charter mail server.
>__Prearrange__ any attachments, with me first.
>
>
>  
>
HTH,

JMJ



More information about the Python-list mailing list