codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🖥️

Operating Systems

25 chapters

1Intro to OS & Kernel Architecture2Process Concept & Lifecycle3System Calls & Interrupts4Process Management & PCB5Inter-Process Communication (IPC)6CPU Scheduling (FCFS, SJF, RR)7Threads (User vs Kernel Level)8Process Synchronization9Critical Section Problem10Producer-Consumer Problem11Dining Philosophers Problem12Deadlock Conditions & Prevention13Banker's Algorithm (Avoidance)14Memory Management & Paging15Memory Allocation (First Fit, Best Fit)16Paging and Segmentation17Translation Lookaside Buffer (TLB)18Virtual Memory & Demand Paging19Page Replacement Algorithms20Thrashing21File Systems & Directory Structure22File Allocation Methods23Disk Scheduling Algorithms24I/O Systems & DMA25OS Protection & Security
SubjectsOperating Systems

Inter-Process Communication (IPC)

Updated 2026-05-01
2 min read

Inter-Process Communication (IPC)

Processes running on an OS are isolated from each other for security. One process cannot directly access another's memory. IPC provides controlled mechanisms for processes to communicate and share data.

1. Shared Memory

Two or more processes share a common region of physical memory. One process writes data to the shared region, and others read from it.

  • Pros: Fastest IPC method (no kernel involvement after setup).
  • Cons: Requires explicit synchronization (semaphores/mutexes) to prevent race conditions.
  • POSIX API: shmget(), shmat(), shmdt().

2. Message Passing

Processes communicate by sending and receiving messages through the kernel. No shared memory is needed.

  • send(destination, message) and receive(source, message).
  • Can be blocking (synchronous) or non-blocking (asynchronous).
  • Pros: No synchronization issues (the kernel handles ordering).
  • Cons: Slower than shared memory due to data copying between user and kernel space.

3. Pipes

A Pipe is a unidirectional byte stream connecting the output of one process to the input of another.

  • Unnamed Pipes: Used between parent-child processes. Created with pipe(). Data flows in one direction. The shell | operator uses pipes: ls | grep .txt.
  • Named Pipes (FIFOs): Exist as special files in the filesystem. Unrelated processes can communicate through them. Created with mkfifo().

4. Sockets

A Socket is a bidirectional communication endpoint that can connect processes on the same machine (Unix domain sockets) or across a network (Internet sockets using TCP/IP).

  • Most versatile IPC mechanism. Supports both local and remote communication.
  • Used by virtually all networked applications (web servers, databases, chat apps).

5. Signals

A Signal is a lightweight asynchronous notification sent to a process to notify it of an event. The process can handle, ignore, or use the default action for each signal.

  • SIGKILL (9): Forcefully terminates a process (cannot be caught or ignored).
  • SIGTERM (15): Politely requests termination (can be caught for graceful shutdown).
  • SIGINT (2): Sent when user presses Ctrl+C.
  • SIGSEGV (11): Segmentation fault (invalid memory access).


PreviousProcess Management & PCBNextCPU Scheduling (FCFS, SJF, RR)

Recommended Gear

Process Management & PCBCPU Scheduling (FCFS, SJF, RR)