Skip to content
Part IA Lent Term

IPC: Summary and Tripos Comparison

The 2019 comparison question (Q4)

The 2019 Tripos asked for a direct comparison of signals, pipes, and named pipes in terms of how easily they support IPC. The mark scheme offers a clear grading:

Signals are the weakest IPC mechanism:

  • Asynchronous — the sender does not know if or when the signal was delivered.
  • No payload beyond the signal number.
  • No synchronisation — the sender’s only feedback is the return value of kill() (which only confirms the signal was queued, not delivered).
  • Suitable for notification (“child has terminated”), not for data transfer.

Pipes are substantially more capable:

  • Byte-stream data transfer — arbitrary volumes.
  • Synchronisation built into the read/write interface (blocking semantics).
  • Related processes only (inherited descriptors) — the parent-child relationship is the addressing mechanism.
  • Cannot be used between unrelated processes.

Named pipes extend pipes to unrelated processes:

  • Exist in the file-system namespace — any process can open by name.
  • Same byte-stream semantics as anonymous pipes.
  • The file-system entry provides a stable name that survives process lifetimes.

The bigger picture

The evolution from signals → pipes → named pipes → sockets → shared memory traces a path of increasing power and complexity:

MechanismDataSynchronisationAddressingUsed for
Signals1 intNoneBy PIDNotification, termination
PipesByte streamBuilt-inParent-childShell pipelines, simple IPC
Named pipesByte streamBuilt-inFile pathClient-server (legacy)
UNIX socketsStream/datagramBuilt-inFile pathLocal client-server
Shared memoryRaw bytesNone (must add)Key/pathHigh-throughput data sharing

Choosing the right mechanism

  • Notification (“task done”) → signal.
  • Streaming data between shell commands → anonymous pipe.
  • Client-server on the same machine → UNIX-domain socket (or named pipe for very simple cases).
  • High-throughput bulk data sharing → shared memory + semaphores.
  • Cross-network → TCP/UDP sockets.

Summary

  • Signals are for notification, not data.
  • Pipes are for byte streams between related processes.
  • Named pipes are pipes with file-system names for unrelated processes.
  • The choice of IPC mechanism depends on the data volume, synchronisation needs, and process relationship.

Past Paper Questions

2019 Paper 2 Question 4(b): Compare UNIX signals, pipes, and named pipes in terms of how easily they support interaction between processes. [6 marks]