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

Guido van Rossum guido@python.org
Thu, 29 Aug 2002 11:43:45 -0400


> I do think that there is a need for a SMP friendly Python runtime.

Feel free to submit patches to Python.  This was tried before, making
many of the internal data structures thread-safe and adding
fine-grained locks where necessary.  The net effect was a 50%
slow-down on uniprocessor machines running Linux.  On Windows it was a
bit better (Windows has more efficient low-level locks than Linux) but
still a significant slowdown.

So whether there's a need or not, I believe we'll all have to cope.
The multi-process approach works well.  For certain specialized
applications, it also works to write an extension module in C that
releases the GIL around CPU intensive calculations (as long as those
calculations don't touch any Python objects).

--Guido van Rossum (home page: http://www.python.org/~guido/)