To prepare for this homework assignment, read the the Unix man pages on the read(), write(), close(), pipe(), fork(), exit() and wait() system calls (for any UNIX system, you should find these in section 2 of the manual). Note that some of these are very complex, but that, for the purpose of this assignment, the only relevant details involve the interaction between these system calls, and not their relation to other calls. These primitives provide Unix with a fairly general set of tools for writing parallel programs where the processes making up the parallel programs communicate via FIFO channels.
Note that the notation cobegin a; b; c coend is frequently used to indicate the execution of statements a, b and c in parallel, while begin a; b; c end indicates that a, b and c are executed in sequence.
cobegin a; b; c; coend
begin
Note that this second problem is a bit tricky because the cobegin coend notation doesn't imply parent-child relationships, while the Unix fork primitive establishes a clear set of parent child relationships. Furthermore, this problem has been constructed in such a way that you are forced to create a parent with more than one child and then wait for one specific child to terminate.