The reliability of python threads

Aahz aahz at pythoncraft.com
Wed Jan 24 21:52:30 CET 2007


In article <mailman.3092.1169657938.32031.python-list at python.org>,
Carl J. Van Arsdall <cvanarsdall at mvista.com> wrote:
>
>Hey everyone, I have a question about python threads.  Before anyone 
>goes further, this is not a debate about threads vs. processes, just a 
>question.
>
>With that, are python threads reliable?  Or rather, are they safe?  I've 
>had some strange errors in the past, I use threading.lock for my 
>critical sections, but I wonder if that is really good enough.
>
>Does anyone have any conclusive evidence that python threads/locks are 
>safe or unsafe?

My response is that you're asking the wrong questions here.  Our database
server locked up hard Sunday morning, and we still have no idea why (the
machine itself, not just the database app).  I think it's more important
to focus on whether you have done all that is reasonable to make your
application reliable -- and then put your efforts into making your app
recoverable.

I'm particularly making this comment in the context of your later point
about the bug showing up only every three or four months.

Side note: without knowing what error messages you're getting, there's
not much anybody can say about your programs or the reliability of
threads for your application.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Help a hearing-impaired person: http://rule6.info/hearing.html



More information about the Python-list mailing list