Inter Process Communication (IPC) Last Updated : 29 Aug, 2025 Comments Improve Suggest changes 224 Likes Like Report Processes need to communicate with each other in many situations. Inter-Process Communication or IPC is a mechanism that allows processes to communicate. It helps processes synchronize their activities, share information and avoid conflicts while accessing shared resources.There are two method of IPC, shared memory and message passing. An operating system can implement both methods of communication.Shared MemoryCommunication between processes using shared memory requires processes to share some variable and it completely depends on how the programmer will implement it. Processes can use shared memory for extracting information as a record from another process as well as for delivering any specific information to other processes. Shared MemoryIn the above shared memory model, a common memory space is allocated by the kernel.Process A writes data into the shared memory region (Step 1).Process B can then directly read this data from the same shared memory region (Step 2).Since both processes access the same memory segment, this method is fast but requires synchronization mechanisms (like semaphores) to avoid conflicts when multiple processes read/write simultaneously.Message PassingMessage Passing is a method where processes communicate by sending and receiving messages to exchange data.In this method, one process sends a message and the other process receives it, allowing them to share information. Message Passing can be achieved through different methods like Sockets, Message Queues or Pipes.Message PassingIn the above message passing model, processes exchange information by sending and receiving messages through the kernel.Process A sends a message to the kernel (Step 1).The kernel then delivers the message to Process B (Step 2).Here, processes do not share memory directly. Instead, communication happens via system calls (send(), recv(), or similar).This method is simpler and safer than shared memory because there’s no risk of overwriting shared data, but it incurs more overhead due to kernel involvement.Please refer Methods in Inter process Communication for more details. Suggested Quiz Edit Quiz 4 Questions Which of the following is an advantage of shared memory IPC? A No need for synchronization B Messages are delivered automatically by the kernel C Faster communication since memory is accessed directly D No need for the programmer to manage data sharing Explanation: Shared memory allows both processes to access the same memory region directly, making communication faster. However, it requires synchronization to prevent conflicts. In message passing IPC, communication occurs through: A A shared memory region allocated by the programmer B Direct access to physical memory C A file system used as a buffer D System calls such as send() and recv() Explanation: Message passing uses system calls like send() and recv(). The kernel handles message delivery, not shared memory. Which statement about shared memory is correct? A Processes share a common memory region created by the kernel B It is slower because every communication goes through the kernel C It never requires synchronization mechanisms D It avoids conflicts automatically Explanation: In shared memory, the kernel allocates a shared region that both processes can access. Synchronization is required to avoid data races Which IPC method is considered simpler and safer? A Shared memory B Message passing C Direct I/O D Interrupts Explanation: Message passing is safer and simpler because processes do not share memory directly. The kernel handles communication, reducing risk of overwriting or conflicts. Quiz Completed Successfully Your Score : 2/4 Accuracy : 0% Login to View Explanation 1/4 1/4 < Previous Next > Comment K kartik 224 Improve K kartik 224 Improve Article Tags : Operating Systems GATE CS Process Synchronization Explore OS BasicsIntroduction to Operating System5 min readTypes of Operating Systems7 min readKernel in Operating System3 min readSystem Call2 min readWhat happens when we turn on computer?3 min readProcess ManagementIntroduction of Process Management3 min readCPU Scheduling in Operating Systems7 min readIntroduction to Process Synchronization4 min readSolutions to Process Synchronization Problems4 min readClassical IPC Problems2 min readIntroduction of Deadlock in Operating System2 min readHandling Deadlocks2 min readMultithreading in OS - Different Models4 min readMemory ManagementIntroduction to memory and memory units2 min readMemory Management in Operating System5 min readBuddy System - Memory Allocation Technique4 min readOverlays in Memory Management4 min readVirtual Memory in Operating System7 min readPage Replacement Algorithms in Operating Systems5 min readOperating system based Virtualization5 min readI/O ManagementFile Systems in Operating System4 min readImplementing Directory Management using Shell Script3 min readSecondary Memory7 min readDisk Scheduling Algorithms9 min readDifference between Spooling and Buffering5 min readImportant LinksLast Minute Notes â Operating Systems15+ min readOperating System Interview Questions15+ min read Like