Subj : Re: threaded program and wait() call To : comp.programming.threads From : ptjm Date : Sun Aug 07 2005 05:28 pm In article <1123280898.049380.245390@g44g2000cwa.googlegroups.com>, tadek wrote: % Process creates two threads. In the 'main' thread module, I install % signal handler for SIGTERM and SIGHUP. I don't understand why you're creating two threads here. Why not simply fork() off the child? After all, your drone thread seems to be waiting for the worker to crash, but if the worker crashes, it will take the drone with it. This is better done by forking off a child and having the parent process block in waitpid() (or not block in waitpid() if it has something useful to do. If there is some reason to use threads, you should ensure you block SIGCLD in the drone thread, and you might as well use g_shutdown to tell the child to shut down, rather than screwing around with signals. % PS I am also confused whether I am using LinuxThreads or NPTL when % linking with glibc and making calls to pthread_* functions. You'll be better off using NPTL. It has more portable behaviour, it is the future, and it's here now. -- Patrick TJ McPhee North York Canada ptjm@interlog.com .