0% found this document useful (0 votes)
70 views3 pages

Unit 2 - IPC

Interprocess communication allows processes to communicate with each other by notifying of events or transferring data. Synchronization is required for interprocess communication and can be provided by semaphores, mutual exclusion, barriers, or spinlocks. Common approaches to interprocess communication include pipes, sockets, files, signals, shared memory, and message queues.

Uploaded by

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

Unit 2 - IPC

Interprocess communication allows processes to communicate with each other by notifying of events or transferring data. Synchronization is required for interprocess communication and can be provided by semaphores, mutual exclusion, barriers, or spinlocks. Common approaches to interprocess communication include pipes, sockets, files, signals, shared memory, and message queues.

Uploaded by

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

UNIT 2 – INTERPROCESS COMMUNICATION

Interprocess 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.

Synchronization in Interprocess Communication

Synchronization is a necessary part of interprocess communication. It is


either provided by the interprocess control mechanism or handled by the
communicating processes. Some of the methods to provide synchronization
are as follows −

• Semaphore

A semaphore is a variable that controls the access to a common


resource by multiple processes. The two types of semaphores are
binary semaphores and counting semaphores.

• Mutual Exclusion

Mutual exclusion requires that only one process thread can enter the
critical section at a time. This is useful for synchronization and also
prevents race conditions.

• Barrier
A barrier does not allow individual processes to proceed until all the
processes reach it. Many parallel languages and collective routines
impose barriers.

• Spinlock

This is a type of lock. The processes trying to acquire this lock wait in
a loop while checking if the lock is available or not. This is known as
busy waiting because the process is not doing any useful operation
even though it is active.

Approaches to Interprocess Communication

The different approaches to implement interprocess communication are


given as follows −

• Pipe

A pipe is a data channel that is unidirectional. Two pipes can be used


to create a two-way data channel between two processes. This uses
standard input and output methods. Pipes are used in all POSIX
systems as well as Windows operating systems.

• Socket

The socket is the endpoint for sending or receiving data in a network.


This is true for data sent between processes on the same computer or
data sent between different computers on the same network. Most of
the operating systems use sockets for interprocess communication.
• File

A file is a data record that may be stored on a disk or acquired on


demand by a file server. Multiple processes can access a file as
required. All operating systems use files for data storage.

• Signal

Signals are useful in interprocess communication in a limited way.


They are system messages that are sent from one process to another.
Normally, signals are not used to transfer data but are used for remote
commands between processes.

• Shared Memory

Shared memory is the memory that can be simultaneously accessed


by multiple processes. This is done so that the processes can
communicate with each other. All POSIX systems, as well as Windows
operating systems use shared memory.

• Message Queue

Multiple processes can read and write data to the message queue
without being connected to each other. Messages are stored in the
queue until their recipient retrieves them. Message queues are quite
useful for interprocess communication and are used by most operating
systems.

You might also like