Subj : Re: How to suspend threads of father process after fork() To : comp.programming.threads From : David Schwartz Date : Fri Jun 03 2005 04:43 am "tony" wrote in message news:1117791984.311866.98590@f14g2000cwb.googlegroups.com... >I am a green hand to multithreads. And now a problem strikes me > greatly, > would you give me a hand? On linux system, I want to write a program > which will > create several threads and fork a child process. And I hope parent > process and > the several threads would suspend for a time to wait for the child > process to > execute firstly. But now, I can only stop the father process while > threads are > reluctant to stop. I also set the thread atrribute inheritsched to be > PTHREAD_INHERIT_SCHED, hoping that when the process(also the father > thread) which > creates these threads blocks, these threads will suspend too. However, > my effort > seems to be useless. Would you give me some suggestions on how to stop > the threads > when waiting for the child process to execute? Your question doesn't make sense. If the threads have useful work to do, why stop them? And if they have no useful work to do, why are they running anyway? DS .