The reliability of python threads

Carl J. Van Arsdall cvanarsdall at mvista.com
Wed Jan 24 19:43:11 CET 2007


Chris Mellon wrote:
> On 24 Jan 2007 18:21:38 GMT, Nick Maclaren <nmm1 at cus.cam.ac.uk> wrote:
>   
>> [snip]
>>
>>     
>
> I'm aware of the issues with the POSIX threading model. I still stand
> by my statement - bringing up the problems with the provability of
> correctness in the POSIX model amounts to FUD in a discussion of
> actual problems with actual code.
>
> Logic and programming errors in user code are far more likely to be
> the cause of random errors in a threaded program than theoretical
> (I've never come across a case in practice) issues with the POSIX
> standard.
>   
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. 

It still proves difficult, but reassurance of the threading model helps 
me focus my efforts.

> Emphasizing this means that people will tend to ignore bugs as being
> "the fault of POSIX" rather than either auditing their code more
> carefully, or avoiding threads entirely (the second being what I
> suspect your goal is).
>
> As a last case, I should point out that while the POSIX memory model
> can't be proven safe, concrete implementations do not necessarily
> suffer from this problem.
>   
Would you consider the Linux implementation of threads to be concrete?

-carl

-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list