Professional Documents
Culture Documents
Systems
Lecture 8
Agenda for Today
Review of previous lecture
Interprocess communication (IPC)
and process synchronization
UNIX/Linux IPC tools (pipe, named
pipe—FIFO, socket, message
queue, shared memory)
Use of pipe
Producer-consumer problem
Mailbox sharing
P1, P2, and P3 share mailbox A.
P1, sends; P2 and P3 receive.
Who gets the message?
#include <unistd.h>
int pipe (int filedes[2]);
parent child
fork
P P
Read Write
end end