The reliability of python threads

  • Thread starter Carl J. Van Arsdall
  • Start date
C

Carl J. Van Arsdall

John said:
This has all been so vague. How does it die?
Well, before operating on most of the data I perform type checks, if the
type check fails, my system flags an exception. Now i'm in the process
of finding out how the data went bad. I gotta wait at this point
though, so I was investigating possibilities so I could find a new way
of throwing the kitchen sink at it.

It would be useful if Python detected obvious deadlock. If all threads
are blocked on mutexes, you're stuck, and at that point, it's time
to abort and do tracebacks on all threads. You shouldn't have to
run under a debugger to detect that.

Then a timer, so that if the Global Python Lock
stays locked for more than N seconds, you get an abort and a traceback.
That way, if you get stuck in some C library, it gets noticed.

Those would be some good basic facilities to have in thread support.
I agree. That would be incredibly useful. Although doesn't this spark
up the debate on threads killing threads? From what I understand, this
is frowned upon (and was removed from java because it was dangerous).
Although I think that if there was a master or control thread that
watched the state of the system and could intervene, that would be
powerful. One way to do this could be to use processes, and each
process could catch a kill signal if it appears to be stalled, although
I am absolutely sure there is more to it than that. I don't think this
could be done at all with python threads though, but as a fan of python
threads and their ease of use, it would be a nice and powerful feature
to have.


-carl


--

Carl J. Van Arsdall
(e-mail address removed)
Build and Release
MontaVista Software
 
S

Steve Holden

Carl said:
Steve said:
[snip]

Are you using memory with built-in error detection and correction?
You mean in the hardware? I'm not really sure, I'd assume so but is
there any way I can check on this? If the hardware isn't doing that, is
there anything I can do with my software to offer more stability?
You might be able to check using the OS features (have you said what OS
you are using?) - alternatively Google for information from the system
supplier.

If you don't have that feature in hardware you are up sh*t creek without
a paddle, as it can't be emulated.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com
See you at PyCon? http://us.pycon.org/TX2007
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top