Threading in Python

Skip Montanaro skip at pobox.com
Fri Jul 27 10:56:46 EDT 2001


(Andy, I'm not picking on you.)

    andy> There seems to be a lot of (arguably) radical changes going on in
    andy> the Python syntax/grammar/language, perhaps the direction should
    andy> be towards improving the internals first?

    andy> One thing Java has which Python lacks is transparent support for
    andy> multi-cpu threading.  Python has threads, but I believe it is
    andy> internally implemented and has been shown not to take advantage of
    andy> an SMP machine.

Folks, you should all know where the Python source code is.  If not, I'll
remind you where you can download it:

    http://sourceforge.net/projects/python/

Python is open source.  That means you can make improvements and submit them
to SF.  People do it all the time.  PythonLabs is not a large organization
(a half dozen developers at most, with some kibbitzing from the rest of
Digital Creations) and they have other higher priority tasks that prevent
them from implementing a virtual machine that is 10x, 5x or even 2x faster
than the current implementation at the moment.

One of the advantages of open source is anyone can hack on it.  One of the
disadvantages of open source is the development community takes what it can
get in the way of skills.  Most of us interested in Python are probably
application programmers.  Compiler experts are a lot harder to find.  It may
well be that the Python community doesn't have a JIT compiler or SMP
multi-threading guru or two laying about with a few months free to devote to
such a project.  (There's Tim Peters, but I never get the impression he has
a lot of time to spare.)  Sun, on the other hand, has the money necessary to
go out and hire someone (several someones, more than likely) with the
necessary skills and make it their job to add JIT compilation or efficient
SMP multi-threading to Java.  In fact, you could argue that they have to do
these sorts of things to keep Java from being crushed by Microsoft.  Python
is generally not under such competitive pressures.  Consequently, it's
likely that you'll see more whiz bang compiler stuff in the Java environment
for the foreseeable future than in the Python environment.

That doesn't mean it won't happen, but it might not happen at the same rate
as in other environments.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list