operating-systems concurrency

Definition

Inter-Process Communication (IPC)

Inter-process communication provides mechanisms for processes to communicate and synchronise their actions. It is essential for coordinating cooperating processes in a multitasking environment.

Models

Shared Memory

A memory region is mapped into multiple processes’ address spaces. Processes exchange data by reading and writing this shared region.

Benefit: Maximum speed (memory access).
Challenge: Requires explicit mutual exclusion to prevent race conditions.

Message Passing

Processes exchange data via send/receive primitives, with kernel mediation.

Benefit: Easier to implement in distributed systems.
Challenge: Higher overhead due to kernel intervention per message.

Comparison

FeatureShared MemoryMessage Passing
CommunicationMemory read/writesend/receive
SpeedHigh (memory speed)Lower (system call overhead)
SynchronisationManual (semaphores, etc.)Implicit in primitives
SuitabilityLocal communicationDistributed systems