How cooperative processes communicate with each other? Explain methods of Inter process communication(IPC).

This answer is restricted. Please login to view the answer of this question.

Login Now

Cooperating processes need an inter-process communication (IPC) mechanism that will allow them to exchange data and information. Two basic models of inter-process communication are there: shared memory and message passing. A region of memory that is shared by cooperating processes is established, in the shared-memory model.

Processes can then exchange their information by reading and writing data to the shared region. In the message-passing model, communication takes place by means of messages exchanged between the cooperating processes. The two communications models are contrasted in the Figure below. Both of the models are mentioned, common in operating systems, and many systems implement both. Message passing is needful for exchanging smaller amounts of data because no conflicts need be avoided. It is also easier to implement in a distributed system than in shared memory. Once shared memory is initiated, all accesses are treated as routine memory accesses, and no assistance from the kernel is required. It suffers from cache coherency issues, which arise because shared data migrate among the several caches. Since the number of processing cores on systems increases, it is possible that we will see message passing as the preferred mechanism for IPC.

- Hamro CSIT

Methods

  1. Pipes (Same Process) –
    This allows the flow of data in one direction only. Analogous to simplex systems (Keyboard). Data from the output is usually buffered until the 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. 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 queues. This is managed by the 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 that 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 that is computer and OS-independent.
If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .