On 25 Jul 2006 05:51:47 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >[EMAIL PROTECTED] writes: >> Threadicide would not solve the problems you actually have, and it >> tends to create other problems. What is the condition that makes >> you want to kill the thread? Make the victim thread respond to that >> condition itself. > >If the condition is a timeout, one way to notice it is with sigalarm, >which raises an exception in the main thread. But then you need a way >to make something happen in the remote thread.
Raising an exception in your own thread is pretty trivial. SIGALRM does no good whatsoever here. :) Besides, CPython will only raise exceptions between opcodes. If a misbehaving thread hangs inside an opcode, you'll never see the exception from SIGALRM. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list