IPC in Message-Passing Systems

IPC provides a way to communicate without sharing a file/vars:

size of message can be fixed or variable

How to do it:

  1. Create a link
  1. 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:

Indirect Communication

Messages are sent to and received via ports (mailboxes)

Each port:

Properties of Indirect Communication link:

How indirect is done:

  1. create a new port
  1. send and receive messages via that port
  1. 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:

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.

Named Pipes

Named pipes – can be accessed without a parent-child relationship.