What is situation with threads in Python

Bill Mill bill.mill at gmail.com
Mon Apr 25 14:10:28 EDT 2005


On 4/25/05, Leonard J. Reder <reder at jpl.nasa.gov> wrote:
> Hello Mark,
> 
> I took your three day course here at JPL and recall that you said
> something was wrong with the implementation of threads within Python
> but I cannot recall what.  So what is wrong with threads in Python?

I'm going to guess that he meant the Global Interpreter Lock is what's
wrong with Python threads. You can read about it in the docs at
http://docs.python.org/api/threads.html and get some good analysis
from Ian Bicking (with some excellent, and some not so excellent,
comments): http://blog.ianbicking.org/gil-of-doom.html .

> 
> The other part of this question is, if there is something wrong with
> the threads in Python has anyone wrapped the Posix threads C api using
> swig to fix this problem?  I work on Solaris/Linux systems and this
> seems like a quick fix - maybe.
> 

Nope, since the interpreter is not entirely thread-safe, I don't
believe you can wrap pthreads.

> Enjoyed the class a great deal.  I am also sending this to the news
> group in hopes of various interesting replies.  Maybe there is a web
> article on this topic already that someone could send the URL.
> 
> Thanks for all replies,
> 
> Len
> --
> ____________________________________________________
> Leonard J. Reder
> Jet Propulsion Laboratory
> Interferometry Systems and Technology Section 383
> Email: reder at huey.jpl.nasa.gov
> Phone (Voice): 818-354-3639
> Phone (FAX): 818-354-4357
> Mail Address:
> Mail Stop: 171-113
> 4800 Oak Grove Dr.
> Pasadena, CA. 91109
> ---------------------------------------------------
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list