Subj : Re: Linux - waitpid portability To : comp.programming.threads From : Giancarlo Niccolai Date : Fri Feb 04 2005 07:46 am Patrick TJ McPhee wrote: > In article , > wrote: > > % I searched for a solution, and understand that in Linux, the thread > % which fork()ed the process must reap the process status using > % waitpid(). This means a major change in the design. Could anybody > % suggest a way to monitor processes created by other threads in Linux, > % in a multithreaded application described above? > > Do you need to support all versions of Linux? Versions which > support NPTL (the new posix threads library) won't have this problem. > > If you do need to support older versions, you pretty much have > to reap the process status from the thread that started the > child process. > Try Wefts++; the Process class installs a cleanup handle so that if the calling thread is destroyed or terminates, the child process is killed (and it's pid reaped wit waitpid), and if not, the calling thread can manage the situation. Works on win, linux and, if users reports are correct, solaris. http://wefts.sf.net Gian. .