Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Python Programming Language

Killing Threads


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

> 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)

Actually all it does is to tell the at_exit-handler that it's ok to
terminate even though there are still some threads. The OS isn't
concerned with this.

Diez

Thanks for this Diez and Tim,

I'll take a look into this today, sorry for not posting any code fragments,
its not so much a fragment as it is a bloody great big monster :-D

Rob

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc