Subj : Re: threads and signals To : comp.programming.threads From : Loic Domaigne Date : Tue Jan 11 2005 10:18 pm Hello Frank, > I have a problem in some existing code. > > A process A calls fork and execl to start a new process B. > A signal handler for termination(SIGTERM) is installed in the main > thread of program B. > In this multithreaded process B four joinable threads are started. > When process A calls kill(pPid,SIGTERM), the handler in process B is > never called. Why ? On which OS / implementation? Is it, by chance, Linux with LinuxThreads? When you fork() + exec(), you start a new process. So you could just start process B from the shell, and send from there the SIGTERM. Logically, process B should also fail to react to SIGTERM... Which would prove that there is an issue in the signal handling of B. Could you perhaps send us an excerpt for the signal handling in B ? > How is the correct use of signal handlers in combination with fork, > execl and multithreaded programs ? No there nothing special about it... if you implement signal handling as it "should be" for multithreaded code Regards, Loic. .