0
2.4kviews
Exlain the following in brief: i) Process Synchronisation ii) Inter-Process Communication (IPC)

Subject: Operating System

Topic: Synchronization and Deadlocks

Difficulty: Medium

1 Answer
0
58views

Process synchronization

  • Each process executes its own operations on shared variables sequentially, as specified by its own program. Nevertheless, different processes may execute their operations on the same shared variable concurrently. That is, operation executions of different processes may overlap, and they may affect one another.

  • Each operation on a shared variable, when executed indivisibly, transforms the variable from one consistent value to another. However, when the operations arc executed concurrently on a shared variable, the consistency of its values may not the guaranteed.

  • The behaviors of operation executions on shared variables must, be predictable for effective inter-process communication.

  • Thus, operation executions on shared variables may need to be coordinated to ensure their consistency semantics.

  • Coordination of accesses to shared variables is called synchronization.

  • A synchronization solution coordinates accesses from processes to shared variables. As shown in Figure, where all accesses to shared variables are channeled through access controllers

enter image description here

  • The controllers do the coordination. Most operating systems implement a few different synchronization schemes for process coordination purposes. Each scheme supports a set of primitives. The primitives are used when it is absolutely necessary to have orderly executions of operations on shared variables in a particular manner.

Inter-Process Communication:

  1. Inter-Process Communication (IPC) is the activity of sharing data across multiple and commonly specialized processes using communication protocols.

  2. Typically, applications using IPC are categorized as clients and servers.

  3. Client requests data and the Server responds to client requests.

  4. IPC has ability to communicate between two cooperating process.

  5. IPC is used in many contexts, such as a producer – consumer problem.

enter image description here

Methods of IPC:

I) Pipes:

  1. It is simplest of all the IPCs.

  2. A pipe enables one way communication between a processes.

  3. When process terminates, pipe is removed automatically.

II) FIFO:

  1. FIFO Stands for First In First Out.

  2. It is also called as Named Pipes.

  3. A FIFO enables unidirectional communication between a processes.

III) Message Queue:

  1. It is used in implementation of Message Passing IPC.

  2. Message Queue will remain, even if the process have existed.

  3. It can be unidirectional or bidirectional.

IV) Shared Memory:

  1. It includes a memory segment which is shared by two or more processes.

  2. When a process creates a memory segment for IPC from its logical address space.

  3. Other process can attach that available space for communication.

  4. Shared Memory is one of the most simplest & Logical Implementation of IPC.

Please log in to add an answer.