The reliability of python threads

Klaas mike.klaas at gmail.com
Wed Jan 24 19:07:34 EST 2007


On Jan 24, 10:43 am, "Carl J. Van Arsdall" <cvanarsd... at mvista.com>
wrote:

> Yea, typically I would think that.  The problem I am seeing is
> incredibly intermittent.  Like a simple pyro server that gives me a
> problem maybe every three or four months.  Just something funky will
> happen to the state of the whole thing, some bad data, i'm having an
> issue tracking it down and some more experienced programmers mentioned
> that its most likely a race condition.  THe thing is, I'm really not
> doing anything too crazy, so i'm having difficult tracking it down.  I
> had heard in the past that there may be issues with threads, so I
> thought to investigate this side of things.

POSIX issues aside, Python's threading model should be less susceptible
to memory-barrier problems that are possible in other languages (this
is due to the GIL).  Double-checked locking, frinstance, is safe in
python even though it isn't in java.

Are you ever relying solely on the GIL to access shared data?

-Mike




More information about the Python-list mailing list