threading questions

Oleg Leschov kalmas at udm.ru
Sat Nov 2 01:29:56 EST 2002


Using python 2.2,
I am trying to implement fairly stable application in Python that is heavily
relies on threads. There are currently two problems I have with this task.
1. I want to be able, using whatever the threading.get_ident() returns (perhaps),
to determine the state of thread (does it still run or not), and to kill the
thread, in case that it, for example, is waiting for some data from socket whose
network interface has died unexpectedly.
For now I rely on the behavior of linux, where when main thread quits, all its
children threads are also being killed. But to me, it would be nicer to kill them
by hand..
2. I want to process user interrupt (ctrl-c), which does not work at all while
running multiple threads, by setting some event so that main thread would quit.
How do I register handler for this?
btw, are there any signals available on windows, and if yes, where are they
listed?



More information about the Python-list mailing list