Parallelization on muli-CPU hardware?

Aahz aahz at pythoncraft.com
Thu Oct 7 11:03:34 EDT 2004


In article <6db3f637.0410042045.2171ad5f at posting.google.com>,
P.M. <pcm at cpugrid.net> wrote:
>
>My question is, how can I best parallelize the running of separate
>autonomous Python scripts within this app?  Can I run multiple
>interpreters in separate threads within a single process?  In past
>newsgroup messages I've seen advice that the only way to get
>scalability, due to the GIL, is to use an IPC mechanism between
>multiple distinct processes running seperate interpreters.  Is this
>still true or are there better ways to accomplish this?

I'm not sure where in the thread to hang this, so I went back to the
root to post this reminder:

One critical reason for the GIL is to support CPython's ability to call
random C libraries with little effort.  Too many C libraries are not
thread-safe, let alone thread-hot.  Forcing libraries that wish to
participate in threading to use Python's GIL-release mechanism is the
only safe approach.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

WiFi is the SCSI of the 21st Century -- there are fundamental technical
reasons for sacrificing a goat.  (with no apologies to John Woods)



More information about the Python-list mailing list