IPC in Message-Passing Systems
IPC provides a way to communicate without sharing a file/vars:
- send(location, message)
- receive(location, message)
size of message can be fixed or variable
How to do it:
- Create a link
- send messages
Implementation:
Physical:
- Shared memory
- Hardware bus
- network
Logical:
- Direct or Indirect
- Synchronous or Asynchronous
- Automatic or Explicit buffering
Direct Communication
Properties of direct communication links:
- Links are established automatically
- A link is associated with exactly one pair of communicating processes
- Between each pair there exists exactly one link
- The link may be unidirectional, but is usually bi-directional
Indirect Communication
Messages are sent to and received via ports (mailboxes)
Each port:
- has a unique ID
- can only communicate if each process shares the port
Properties of Indirect Communication link:
- Link established only if processes share a common mailbox
- A link may be associated with many processes
- Each pair of processes may share several communication links
- Link may be unidirectional or bi-directional
How indirect is done:
- create a new port
- send and receive messages via that port
- destroy port
Synchronization
Blocking (synchronous)
Blocking send - sender is blocked until message is received
Blocking receive - receiver is blocked until message is available (i think it means sent)
rendezvous - when both send and receive are blocked
Non-blocking (asynchronous)
Non-Blocking send - can send
Non-Blocking receive - can receive either a NULL value or a message
Buffering
Queue of messages attached to a link
LINK = port
Implementation:
- Zero capacity - no messages are queued on a link. Sender must wait for receiver (rendezvous)
- Bounded capacity - finite length of n messages, sender must wait if link is full
- Unbounded capacity - infinate length, sender never waits
Pipes
Allows two processes to communicate
Ordinary Pipes
Ordinary pipes – cannot be accessed from outside the process that created it.
Typically, a parent process creates a pipe and uses it to communicate with a child
process that it created.

- Ordinary Pipes allow communication in standard producer-consumer style
- Producer writes to one end (the write-end of the pipe)
- Consumer reads from the other end (the read-end of the pipe)
- Ordinary pipes are therefore unidirectional
- Require parent-child relationship between communicating processes
Named Pipes
Named pipes – can be accessed without a parent-child relationship.
- Named Pipes are more powerful than ordinary pipes
- Communication is bidirectional
- No parent-child relationship is necessary between the communicating processes
- Several processes can use the named pipe for communication
- Provided on both UNIX and Windows systems