MezzoNZ / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Killing thread may be overkill #171

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Sometimes, at the interpreter prompt, sending a KeyboardInterrupt just
works like at a normal Python prompt, other times it kills the thread
altogether.  I think it would be worth exploring if one could simply keep
the KeyboardInterrupt signal and forget about the Killable Thread
implementation.

This would have the further advantage of not requiring ctypes, thus making
Crunchy behave the same on Python 2.5 and 2.4.

Original issue reported on code.google.com by andre.ro...@gmail.com on 2 Sep 2008 at 10:38

GoogleCodeExporter commented 8 years ago
Perhaps killing a thread could require two consecutive KeyboardInterrupts.

Original comment by andre.ro...@gmail.com on 19 Aug 2009 at 12:14

GoogleCodeExporter commented 8 years ago
AFAIK, the only reliable way to interrupt another python thread is to throw an
exception in that thread, and currently the only way to do that in pure Python 
is
through cTypes. The killable thread implementation simply throws a 
Keyboardexception
in the specified thread.

If that is killing the interpreter, then it looks like Keyboardexceptions aren't
being caught properly.

Original comment by johannes...@gmail.com on 19 Aug 2009 at 4:41