Skip to main content
Engineering LibreTexts

5.4: Interprocess Communication

  • Page ID
    47659
  • IPC (InterProcess Communication)

    In computer science, inter-process communication or interprocess communication (IPC) refers specifically to the mechanisms an operating system provides to allow the processes to manage shared data. Typically, applications using IPC, are categorized as clients and servers, where the client requests data and the server responds to client requests. Many applications are both clients and servers, as commonly seen in distributed computing.

    An independent process is not affected by the execution of other processes while  cooperating processes can be affected by, and may affect, other executing processes. Though one can think that those processes, which are running independently, will execute very efficiently, in reality, there are many situations where the co-operative nature can be utilized for increasing computational speed, convenience and modularity. Inter process communication (IPC) is a mechanism which allows processes to communicate with each other and synchronize their actions. 

    IPC is very important to the design process for operating system kernels that desire to be kept small, therefore reduce the number of functionalities provided by the kernel. Those functionalities are then obtained by communicating with servers via IPC, leading to a large increase in communication when compared to a regular type of operating system kernel, which provides a lot more functionality. 

    Methods in Interprocess Communication

    There are several different ways to implement IPC. IPC is set of programming interfaces, used by programs to communicate between series of processes. This allows running programs concurrently in an Operating System. Below are the methods in IPC:

    1. Pipes (Same Process) 
      This allows flow of data in one direction only. Analogous to simplex systems (Keyboard). Data from the output is usually buffered until input process receives it which must have a common origin.
    2. Names Pipes (Different Processes) 
      This is a pipe with a specific name it can be used in processes that don’t have a shared common process origin. E.g. is FIFO where the details written to a pipe is first named.
    3. Message Queuing 
      This allows messages to be passed between processes using either a single queue or several message queue. This is managed by system kernel these messages are coordinated using an API.
    4. Semaphores 
      This is used in solving problems associated with synchronization and to avoid race condition. These are integer values which are greater than or equal to 0.
    5. Shared memory 
      This allows the interchange of data through a defined area of memory. Semaphore values have to be obtained before data can get access to shared memory.
    6. Sockets 
      This method is mostly used to communicate over a network between a client and a server. It allows for a standard connection which is computer and OS independent.

    We will discuss a couple of these concepts.

    Adapted from:
     "Inter Process Communication (IPC)" by ShubhamMaurya3Geeks for Geeks is licensed under CC BY-SA 4.0
    "Methods in Interprocess Communication" by Aniket_DuseyGeeks for Geeks is licensed under CC BY-SA 4.0

    • Was this article helpful?