title: Running/pausing child processes in C?
body: <p>I'm running child processes in C and I want to pause and then run the same child process.  Not really sure how to describe my problem in a better way since I'm new at this but here's a shot.</p>
  
  <p>So I know that you can run a process after another process exits by using <code>waitpid</code>.  But what if the process I'm waiting on doesn't exist at the creation of the process that does the waiting.  So in this case, I'm thinking of pausing the process that does the waiting and when the process that is waited is created and then finishes, it would call on the process that does the waiting to run again.  So how would you do this? Again, I'm not familiar with this, so I don't know if this is the proper way to do this.</p>
  
  <p>edit: What I'm trying to do</p>
  
  <p>I'm using child processes to run command via <code>execvp()</code> in parallel so if I have a sequence <code>sleep 1; sleep 1;</code>, the total sleep time will be 1 second.  However there are cases where I try to parallel <code>echo blah &gt; file; cat &lt; file;</code> in which case I'm assuming <code>cat</code> reads the file after <code>echo</code> inputs blah into file.  Therefore, I have to wait for <code>echo</code> to finish to do <code>cat</code>.  There are more specifics to this, but generally assume that for any command with an output to a file must be waited on by any command that reads the file later in the script.</p>