Inter Process Communication - IPC

Inter-Process Communication (IPC) is a set of techniques for the exchange of data among multiple threads in one or more processes. IPC is part of Linux System Programming. In inter-process communication processes may be running on one or more computers connected by a network. IPC is used to communicate one process to another process with in the system or network. IPC techniques helps us to understand how data is transfer with in system from on drive to another drive, from flash-drive to drive. IPC include many techniques to understand flow of data with in the system. It include many techniques like PIPES, FIFO (named pipes), Message Queues, Shared memory and Threads to communicate between process. Process duplication  and Process Replacement is also a part of IPC techniques. To synchronize multiple processes which  communicate in between  techniques used is semaphores, signal.

Types of Inter-Process communication:-

  • Signals - Sent by other processes or the kernel to a specific process to indicate various conditions.
  • Pipes - Unnamed pipes set up by the shell normally with the character to route output from one program to the input of another.
  • FIFOS - Named pipes operating on the basis of first data in, first data out.
  • Message queues - Message queues are a mechanism set up to allow one or more processes to write messages that can be read by one or more other processes.
  • Semaphores - Counters that are used to control access to shared resources. These counters are used as a locking mechanism to prevent more than one process from using the resource at a time.
  • Shared memory - The mapping of a memory area to be shared by multiple processes.
  • Message queues, semaphores, and shared memory can be accessed by the processes if they have access permission to the resource as set up by the object's creator. The process must pass an identifier to the kernel to be able to get the access.

Rules of IPC:-

  • Safety/mutual exclusion: No two processes may be simultaneously inside their critical regions.
  • Liveliness/progress: No process running outside its critical region may block other processes.
  • Contention: If two processes enter a critical region, the conflict should be resolved in favor of one.
  • Fairness/deadlock: No process should have to wait for an unfair amount of time or forever to enter its critical region.

Conclusion:-

If these techniques were not developed processes would not have been able to communicate with another processes also sharing of information could not take place.