Killing/Terminating a running thread

Heiko Wundram heikowu at
Sat Sep 7 13:14:04 EDT 2002

Hi to all!

I've looked over google groups, but I've found no real answer that
satisfied the needs I have. Just a little explanation:

I have a Queue module, which stores method-calls and delegates them to
threads, which take over running the call. Now it happens that a method
takes much longer to complete than I would like it to, and in this case,
the thread running the code should just be terminated, discarding all
values computed so far.

The basic problem I have that it is pretty much impossible to get at the
PID of the thread running the code in question; but I have a reference
to the thread class in a central "garbage-collector" (the queue object).
And anyway, this approach would only work on Unix (I guess), when using
pthreads, which create a "real" subprocess with its own PID for a

Has anyone had a similar problem, and know of a solution?


	Heiko Wundram
	Netzwart Wohnheim-D
	Zimmer 2206 - Universität 18 - 66123 Saarbrücken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <>

More information about the Python-list mailing list