0% found this document useful (0 votes)
5 views

Operating System Course

The document discusses Inter-Process Communication (IPC), which is essential for data exchange and coordination between independent processes in modern operating systems. It covers various IPC methods such as pipes, sockets, shared memory, and synchronization techniques like semaphores and mutual exclusion, along with their advantages and challenges. Additionally, it highlights the importance of IPC in enhancing modularity, performance, scalability, and security, while also addressing potential drawbacks like increased complexity and security risks.
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)
5 views

Operating System Course

The document discusses Inter-Process Communication (IPC), which is essential for data exchange and coordination between independent processes in modern operating systems. It covers various IPC methods such as pipes, sockets, shared memory, and synchronization techniques like semaphores and mutual exclusion, along with their advantages and challenges. Additionally, it highlights the importance of IPC in enhancing modularity, performance, scalability, and security, while also addressing potential drawbacks like increased complexity and security risks.
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/ 25

OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Learning Objectives

Understand the Fundamentals of IPC


 Explore IPC Methods and Mechanisms
 Analyze Synchronization Techniques in IPC
 Evaluate the Advantages and Challenges of IPC
 Apply IPC in Real-World Scenarios

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Inter-Process Communication (IPC)

 IPC refers to the transfer of information and interaction


between multiple processes in an electronic system

 Each tasking process runs independently but may require


communication for data exchange or coordination.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Importance of IPC

 Essential in modern operating systems.

 Used in various applications, from simple control-line


appliances to complex distributed systems.

 Ensures secure and efficient knowledge transmission


between processes.

A diagram that illustrates inter-process communication is


as follows −

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

 Synchronization is a necessary part of inter-process


communication.

 It is either provided by the inter process control


mechanism or handled by the communicating processes.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

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.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Some of the methods to provide synchronization are as follows −

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.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Approaches to Inter-process Communication

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.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Approaches to Inter-process Communication

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 inter process


communication.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Approaches to Inter-process 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 inter-process 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.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Approaches to Inter-process Communication

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 inter-process
communication and are used by most operating systems.
CS-301, Operating System - Spring 2025 - BS-CS, Semester 5
OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

A diagram that demonstrates message queue and shared memory


methods of Inter-process communication is as follows −

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Different Methods of IPC

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Pipes −
 A pipe is a channel of communication that is one-way that
enables a single procedure to transmit data to a different one.

 Pipes can be identified as or unidentified.

 The operations running in anonymous pipes have to be


associated (i.e., both parent and child processes).

 Known pipes, on the contrary together, may be utilized by


processes that are separate from one another.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Message Queues −
 Message queues are employed for inter-process interaction when
both the sending and getting processes do not need to be present at
the same time.

 The asynchronous communications may be sent and received.

 A message in a queue possesses a particular final destination


and is accessible to multiple processes.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Shared Memory −
 Shared memory is an inter process communication method that
enables various programs to make use of a single storage region.

 This allows them to effectively and effectively share data.

 Sharing memory is frequently employed in applications that are


extremely fast.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Semaphores −
 Semaphores serve to keep the utilization of resources that are
shared synchronized.

 Their companies serve as responses that limit the number of


procedures that may utilize a resource that is shared at any given
time.

 Semaphores are useful for implementing critical sections in


which only one process has access to a resource that is shared at a
time.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Socket −
 Sockets constitute an internet-based communications process
that enables procedures to interact with one another over a
network.

 Someone can communicate both locally and remotely.

 In client-server relationships applications, ports are frequently


used.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Remote Procedure Call (RPC) −


 RPC is a procedure that enables a single process to call an
operation in another.

 It allows procedures to call treatments in distant systems as


though they were actually local, enabling distributed computing.

 In systems with distributed components, RPC is frequently


used.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Signals −
 Asynchronous IPC signals are employed for informing an
operator of an occurrence or interference.

 The Operating System (OS) sends communication through


processes as well as between processes.

 Programming based on events can be implemented using


signals.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Advantages
The following are many benefits of employing inter process
communication (IPC) techniques for procedure interaction:

 Increased Modularity − IPC enables developers to divide


large applications into smaller parts that are easier to manage.

 Improved Performance − IPC may enhance the efficiency of


applications by enabling handles to share information and convey
it directly to one another.

 Improved Scalability − IPC may assist enhance an


implementation's adaptability by enabling various processes to
collaborate to complete a task.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Advantages

Improved Fault Tolerance −


 IPC may be employed to enhance an implementation's fault
tolerance by allowing procedures to identify and recuperate from
mistakes.

Increased Security −
 IPC may be employed to enhance security for applications by
managing the utilization of resources that are shared.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Disadvantages
There are also a number of potential drawbacks to keep in mind:

 Increased Complexity − IPC may complicate a program by


needing creators to handle process interaction and
synchronization.

 Increased Overhead − IPC can increase usage overhead by


needing extra processing time as well as memory assets.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Disadvantages
 Increased Risk of Race Condition −
IPC may boost the likelihood of race circumstances, which occur
when several programmers access a resource that is shared at the
same period of time potentially resulting in corruption of
information or other problems.

 Security Risks − Given that interactions between procedures


can be seized or controlled by unauthorized individuals, IPC can
pose safety hazards.

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5


OPERATING SYSTEM – INTER-PROCESS COMMUNICATION

Methods of IPC Info graphic

Disadvantages
 System Dependency −
In accordance with the system that underlies it, distinctive IPC
techniques might come with distinct needs and constraints.

 Debugging and Troubleshooting −


Debugging and troubleshooting IPC related problems can prove
difficult because they might involve numerous procedures with
intricate relationships.

https://www.youtube.com/watch?v=0zRA4PAQCME
https://www.youtube.com/watch?v=nwP-wl8w2Ug

CS-301, Operating System - Spring 2025 - BS-CS, Semester 5

You might also like