Killing Threads

Tim Golden mail at timgolden.me.uk
Wed May 2 03:49:47 EDT 2007


Robert Rawlins - Think Blue wrote:
> I've got an application which I've fearfully placed a couple of threads into
> however when these threads are running it seems as if I try and quite the
> application from the bash prompt it just seems to freeze the SSH client.
> I've also seen that if I have my app running in the background on the system
> then my 'reboot' no longer works, it just hangs after saying it's going to
> shut down.

You really need to post code fragments: it makes it much
easier to see what you've actually done, rather than the
guess which I'm making :)

You probably need to setDaemon (True) on your threads
after you've created them and before they run. That
tells the OS: don't bother waiting for these ones to
finish if the program exits. (At least I think that's
what it does; I don't use threads all that much)

TJG



More information about the Python-list mailing list