0% found this document useful (0 votes)
41 views5 pages

Approaches To Interprocess Communication

Is notes

Uploaded by

srigopi1415
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Approaches To Interprocess Communication

Is notes

Uploaded by

srigopi1415
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

INTER PROCESS COMMUNICATION

Inter process communication is the mechanism provided by the operating system


that allows processes to communicate with each other. This communication could
involve a process letting another process know that some event has occurred or the
transferring of data from one process to another.
A diagram that illustrates inter process communication is as follows −

Approaches to Interprocess Communication


We will now discuss some different approaches to inter-process communication which are as
follows:

These are a few different approaches for Inter- Process Communication:

1. Pipes
2. Shared Memory
3. Message Queue
4. Direct Communication
5. Indirect communication
6. Message Passing
7. FIFO
Pipe:-

The pipe is a type of data channel that is unidirectional in nature. It means that the data in this
type of data channel can be moved in only a single direction at a time. Still, one can use two-
channel of this type, so that he can able to send and receive data in two processes. Typically,
it uses the standard methods for input and output. These pipes are used in all types of POSIX
systems and in different versions of window operating systems as well.

Shared Memory:-

It can be referred to as a type of memory that can be used or accessed by multiple processes
simultaneously. It is primarily used so that the processes can communicate with each other.
Therefore the shared memory is used by almost all POSIX and Windows operating systems
as well.

Message Queue:-

In general, several different messages are allowed to read and write the data to the message
queue. In the message queue, the messages are stored or stay in the queue unless their
recipients retrieve them. In short, we can also say that the message queue is very helpful in
inter-process communication and used by all operating systems.To understand the concept of
Message queue and Shared memory in more detail, let's take a look at its diagram given
below:

Message Passing:-

It is a type of mechanism that allows processes to synchronize and communicate with each
other. However, by using the message passing, the processes can communicate with each
other without restoring the hared variables.Usually, the inter-process communication
mechanism provides two operations that are as follows:

send (message)

o received (message)

Note: The size of the message can be fixed or variable.


Direct Communication:-

In this type of communication process, usually, a link is created or established


between two communicating processes. However, in every pair of communicating
processes, only one link can exist.

Indirect Communication

Indirect communication can only exist or be established when processes share a


common mailbox, and each pair of these processes shares multiple communication
links. These shared links can be unidirectional or bi-directional.

FIFO:-

It is a type of general communication between two unrelated processes. It can also


be considered as full-duplex, which means that one process can communicate with
another process and vice versa.

Some other different approaches


o Socket:-

It acts as a type of endpoint for receiving or sending the data in a network. It is


correct for data sent between processes on the same computer or data sent between
different computers on the same network. Hence, it used by several types of
operating systems.

o File:-

A file is a type of data record or a document stored on the disk and can be acquired
on demand by the file server. Another most important thing is that several processes
can access that file as required or needed.

o Signal:-

As its name implies, they are a type of signal used in inter process communication in
a minimal way. Typically, they are the massages of systems that are sent by one
process to another. Therefore, they are not used for sending data but for remote
commands between multiple processes.

Usually, they are not used to send the data but to remote commands in between
several processes.
Why we need interprocess communication?
There are numerous reasons to use inter-process communication for sharing the
data. Here are some of the most important reasons that are given below:

o It helps to speedup modularity


o Computational
o Privilege separation
o Convenience
o Helps operating system to communicate with each other and synchronize their
actions as well.

COMMUNICATION IN CLIENT SERVER SYSTEMS?

o Client/Server communication involves two components, namely a client and a


server. They are usually multiple clients in communication with a single
server. The clients send requests to the server and the server responds to the
client requests.
o There are three main methods to client/server communication. These are
given as follows −
o Sockets
o Sockets facilitate communication between two processes on the same
machine or different machines. They are used in a client/server framework
and consist of the IP address and port number. Many application protocols
use sockets for data connection and data transfer between a client and a
server.
o Socket communication is quite low-level as sockets only transfer an
unstructured byte stream across processes. The structure on the byte stream
is imposed by the client and server applications.
o A diagram that illustrates sockets is as follows −
o
o Remote Procedure Calls
o These are interprocess communication techniques that are used for client-
server based applications. A remote procedure call is also known as a
subroutine call or a function call.
o A client has a request that the RPC translates and sends to the server. This
request may be a procedure or a function call to a remote server. When the
server receives the request, it sends the required response back to the client.
o A diagram that illustrates remote procedure calls is given as follows −

o
o Pipes
o These are interprocess communication methods that contain two end points.
Data is entered from one end of the pipe by a process and consumed from
the other end by the other process.
o The two different types of pipes are ordinary pipes and named pipes. Ordinary
pipes only allow one way communication. For two way communication, two
pipes are required. Ordinary pipes have a parent child relationship between
the processes as the pipes can only be accessed by processes that created
or inherited them.
o Named pipes are more powerful than ordinary pipes and allow two way
communication. These pipes exist even after the processes using them have
terminated. They need to be explicitly deleted when not required anymore.
o A diagram that demonstrates pipes are given as follows −
o

You might also like