it540 operating system inter-process communication (ipc) · inter-process communication (ipc) ......
TRANSCRIPT
![Page 1: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/1.jpg)
Hussein Omar Hussein ID:163104047
Inter-Process Communication(IPC)
IT540 Operating system
![Page 2: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/2.jpg)
Introduction.
What is IPC?
Types of IPC.
IPC Mechanisms.
Why IPC?.
Potential IPC problems.
Outline
![Page 3: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/3.jpg)
Introduction
• Processes within a system could be independent or cooperating.
• Cooperating: can affect or affected by other process
• Reasons for cooperating:
oInformation sharing.
oComputation speedup.
oModularity.
oConvenience .
• OS provides facilities for IPC.
![Page 4: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/4.jpg)
IPC
Process 1 Process 2
data
sender receiver
![Page 5: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/5.jpg)
What is IPC?
Inter-process Communication is a set of mechanisms or techniques for exchanging Data between two processes or applications.
![Page 6: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/6.jpg)
Types IPC
Inter-process communication can be:-Unicast:
When communication is from one process to a single other process. e.g. Socket communication.
Multicast:When communication is from one process to a group of processes. e.g. Publish/Subscribe Message model.
![Page 7: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/7.jpg)
P2
P1 P1
P2 P3 P4...
unicast multicast
mm m m
![Page 8: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/8.jpg)
• Shared Memory
• Message Passing
• Pipe
• Semaphores
IPC Mechanisms
![Page 9: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/9.jpg)
■ Shared Memory is an efficient means of passing data between
processes. One will create a memory portion which other processes
(if permitted) can access.
■ This shared memory section is used by communicating processes
simultaneously.
■ Also we have to synchronize the processes so they can alter shared
memory simultaneously.
Shared Memory
![Page 10: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/10.jpg)
![Page 11: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/11.jpg)
• Operating system establishes a communication Channel.
• One Process is a sender and the other is Receiver.
• Each process puts the data in the channel.
• IPC messaging lets processes send and receive messages, and queue messages for processing in an arbitrary order.
Message passing
![Page 12: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/12.jpg)
Message passing
![Page 13: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/13.jpg)
•Pipe allow transfer data between processes in First in-First-out manner.
•A pipe is usually realized in memory.
•Pipe operations are memory operations.
pip
![Page 14: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/14.jpg)
Creating pipeline
![Page 15: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/15.jpg)
•They are often used to monitor and control the availability of system resources such as shared memory segments.
•Semaphores are used to synchronize the processes so that they can’t access critical section simultaneously.
Semaphores
![Page 16: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/16.jpg)
•Information sharing.
•Resource sharing.
•Performance speedup.
•Flexibility.
•Maintain protection & isolation.
Why IPC?
![Page 17: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/17.jpg)
• Starvation
Occur when multiple processes or threads compete for access to a shared resource. One process may monopolize the resource while others are denied access.
• Deadlock
Occur when two processes need multiple shared resources at the same time in order to continue.
• Data Inconsistency
Shared resources are modified at the same time by multiple resources.
Potential IPC problems.
![Page 18: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/18.jpg)
• http://faculty.salina.k-state.edu/tim/ossg/IPC
• https://en.wikipedia.org/wiki/Inter-process_communication.
• https://www.slideshare.net/search/slideshow?searchfrom=header&q=inter-process+communication+&ud=any&ft=all&lang=en&sort=.
• https://www.infor.uva.es/~jjalvarez/asignaturas/SD/lectures/chapter2.pdf
• Understanding Operating Systems, Seventh Edition, Ann McIver McHoes & Ida M. Flynn.
• Operating Systems Design and Implementation, Third Edition,
References
![Page 19: IT540 Operating system Inter-Process Communication (IPC) · Inter-Process Communication (IPC) ... • Understanding Operating Systems, ... Ann McIver McHoes & Ida M. Flynn. • Operating](https://reader031.vdocuments.mx/reader031/viewer/2022022013/5b33b6bb7f8b9a436d8b4657/html5/thumbnails/19.jpg)