Python on multi-processor machines (Was Re: [Zope] Re: Windows vs. Linux)

Dennis Allison allison@sumeru.stanford.EDU
Thu, 29 Aug 2002 11:13:02 -0700 (PDT)


On Thu, 29 Aug 2002, AM wrote:

> Related to the topic, I recieved a 2P Athlon MP machine running RH7.3. 
> So how would I go about getting Zope to bind to one processor (if 
> possible) or atleast get the performance on par with a normal 1P machine??
> 
> I dont really have a choice regarding the machine. I did read the 
> article whose link is provided below, however not being an OS person 
> didnt really understand half of it.
> 
> TIA
> AM

That is precisely the configuration I run without problem.

I have not (yet) looked at the Python code, but I am reasonably sure my
intuition is correct.  (Matt or Guido -- correct me if I am wrong...)

First, safety is not an issue modulo thread safety in the uniprocessor
machine and the correctness of the SMP implementation. Multiple threads
allocated to different processors function correctly.  The problem is with
performance since the GIL serializes everything and blocks all processors,
not just the processor on which the thread is running.  This means that
the second processor does not contribute to the execution as it could, so
the effective CPU available is closer to 1.0 than 2.0.