|
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.
|