faqts : Computers : Programming : Languages : Python

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 10 people (80%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How does runs Python 2.x on Windows multi CPU machines?

Dec 11th, 2005 01:52
Reed O'Brien, Michael Chermside, Oliver Dissars,


[NOTE: This is being written by someone who doesn't own a Windows multi
CPU machine, so please correct me if I'm wrong!]

I believe the answer is that it will run, but not much faster than if
you had a single CPU machine. The reason is that the core of Python is
single-threaded -- there is a "global interpreter lock" which means the
interpreter is essentially single-threaded.

You might see slight improvement because certain C-level functions can
be performed without holding the global interpreter lock (eg: file IO),
but don't expect much.


Plone and Zope - discuss processor affinity.
http://plone.org/documentation/faq/server-recommendations
and point to a discussion on python.org
http://www.python.org/doc/faq/library.html#can-t-we-get-rid-of-the-global-interpreter-lock
Linux 2.6 kernel does soft (infrequent migration) and hard (no
migration) affinity.

In windows you can set processor affinity through the taskmgr. Select
the process, right click and select set Affinity. Select and click OK.