Subj : Re: Problem with system() calls in a multithreaded program on HPUX 11 To : comp.programming.threads,comp.sys.hp.hpux From : ptjm Date : Sun Feb 13 2005 10:15 pm In article , Paul Pluzhnikov wrote: % maheshkumarjha@gmail.com (Mahesh Kumar) writes: % % > I am porting a multithreaded program to HPUX 11 from Solaris, in % > which threads make calls to system() functions. % % This is extremely bad idea (TM). % % Writing multithreaded programs that fork() correctly requires % careful use of pthread_atfork handlers for every possible lock used, % both in your code and in every library you link against. I'd say that atfork handlers are largely useless. Whatever you do with mutexes, for instance, is irrelevant because the child process isn't allowed to lock or unlock them anyway. execing a new process image is allowed, though. system() is problematic, but the problem is with waiting for the child process to finish, rather than with forking and execing. -- Patrick TJ McPhee North York Canada ptjm@interlog.com .