1/28
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
INTERPROCESS COMMUNICATION
Process within a system may be independent or cooperating
What is an independent process vs cooperating process?

Reasons for cooperating processes: ?

Cooperating processes need IPC.
what is IPC? are what are its models?

INTERPROCESS COMMUNICATION

COMMUNICATIONS MODELS
high level view of message passing and shared memor

Metaphor for message passing and shared memory:
message passing : mailbox approach
shared memory: bulletin board
shared memory:
in case of shared memory, the processes share portion of the memory as a privately shared bulletin board where only process A and B can access themr
process A can read or write using the shared memory and so can process B
this way process A and B can communicate
message passing:
process cannot communicate directly
they need to write a message like a mail and put it in the mailbox (message queue in the operating system)
the message queue, will store and send and deliver the message to the recipient process
What are the pros and cons of message passing vs shared memory?
SHARED MEMORY PROS AND CONS:
shared memory is easy to use; process A and process B can both write and read in the shared memory area so its fast and easy to use
BUT because both process A and B can access anywhere in the shared memory, without proper control and careful management, the shared memory data may be corrupted or incorrect information used by the processes
MESSAGES PASSING PROS AND CONS:
with message passing, you don’t have to worry about the message content as long as they use the same agreed protocol. Process A and B can safely send and receive messages because all messages are delivered and handled by the operating system
HOWEVER, the message queue is a separate entity from process A and B as well as a regular schedule of the operating system so it means its slower than the shared memeory
process A has to send msg and wait for the operating system to deliver msg to process B
the message queue is maintained by the subsystem of the operating system
Relatively slow speed is the drawback of message passing
Producer-Consumer Problem
paradigm for cooperating processes, producer process produces information that is consumed by a consumer process
* What is unbounded-buffer and bounded-buffer ?
unbounded-buffer places no practical limit on the size of the buffer
bounded-buffer assumes there is a fixed buffer size
it’s a problem but also a design pattern


Inter process Communication - Shared Memory
that was the shared memory solution
Interprocess Communication - Message Passing
What is the Message System?
Message System - processes communicate with each other without resorting to shared variables
Interprocess Communication - Message Passing
What is IPC and what two operations does the facility provide?
IPC facility provides two operations:
send(message)
receive(message)
the message size is either fixed or variable

Interprocess Communication - Message Passing
this is the message passing solution

Message Passing (Cont.)

Message Passing (Cont.)
Direct Communication features

Indirect Communication features

Indirect Communication Operations and Primitives

Indirect Communication

Block vs non-blocking in Synchronization

Buffering:

Examples of IPC Systems - Windows


Communications in Client-Server Systems

Sockets

Remote Procedure Calls
Remote Procedure Calls (Cont.)

Execution of RPC

Pipes

Ordinary Pipes

Named Pipes
