The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-23-2008
Perderabo's Avatar
Perderabo Perderabo is online now
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,452
Good observation! Either parent or child may run first. In a multiprocessor system, they might even run somewhat simultaneously. Should the child run first, it will quickly try to read from the pipe and block until data is available in the pipe. The parent will write to the pipe, but if the pipe fills, the parent will block until the child reads some data out of it (thus freeing up space in the pipe). So the pipe is syncronizing everything.
Reply With Quote