Stopping a Thread
Hi Experts,
How to stop a thread by using commands? Other threads in that process shouldn't disturbed. Is it possible to do the same? I need something similar to kill, which is used to stop a process. Thanks, kumar |
Processes cannot be signalled directly from outside the process.
What I've done in the past is to write a trap (essentially a callback routine) for a signal eg SIGHUP which then eg re-reads the cfg file, in which I've set a value to tell it to terminate or whatever. Of course, if its a server listening on a socket, you could send a special msg that it recognises. |
Probably a best way of doing so is to code your application the way it is possible to stop some thread while running.
Interesting question. |
All times are GMT -5. The time now is 09:36 AM. |