Subj : Re: Killing threads To : comp.programming.threads From : Srini Palthepu Date : Tue Aug 16 2005 06:01 pm Thanks for the mail. >>I am having trouble selectively killing threads. >>When I send SIGKILL or SIGTERM to a thread >>I end up killing the whole process. > > > Yup, that's what the default signal handlers for those signals do. I see. I was under the impression that, since I am sending the signal to specific thread, they should go to the thread. >>Is there something I am overlooking? >>Is there a standard idiom for doing this kind >>of thing? > > > Why are you trying to kill threads? Is cancellation not what you want? > If not, you need to roll your own signalling mechanism. > Without knowing much more about your application structure, I can't > offer better suggestions except to say that it's a thoroughly solved > problem. My application has a set of daemon threads for doing the work that are alocated for each client request. But when a thread hangs in the proces of serving a client for any reason, I need to cleanup. I am trying to kill the hung thread and respawn a new one as a way of cleaning up. I am using ACE toolkit thread framework that essentially will be translated to Solaris thread sys calls at lowlevel. thanks Srini ----- .