



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




receiver.
from sender.
know MAILBOX where it gets its messages!
destroyed
write(pipe_id, message, nbytes) (^) read(pipe_id,buffer,xbytes)
int p[2]; ... ... pipe(p); / creates a pipe and returns ID of read-end in p[0] and ID of write-end in p[1] /
int p[2]; ... ... pipe(p); / creates a pipe and returns ID of read-end in p[0] and ID of write-end in p[1] /
p[1] p[0]
Step 2: P0 creates P1 and P2, which inherit pipes
At this time, any of them can read/write from/to the pipe.
p[1] p[0]
Step 3: all processes close pipe ends which they will not (should not) be accessing:
close(p[0]); close(p[1]);
close(p[1]);
close(p[0])