P3L3 Inter Process Communication - Intro Flashcards
Visual Metaphor
IPC is like …
List 3 ways IPC is like ..
… working together in the toy shop
Workers share area (tools)
- data in shared memory
Workers call eachother (explicit requests & responses)
- exchange messages
Workes need synchronization (“I will start a step, once you finish yours”)
- mutexes
Inter process communication (IPC) refers to a set of __________ that the operating system must support in order to permit multiple processes to _______ amongst each other.
This include mechanisms related to _________, __________ and __________.
Inter process communication (IPC) refers to a set of mechanisms that the operating system must support in order to permit multiple processes to interact amongst each other.
This include mechanisms related to synchronization, coordination and communication.
Define Inter Process Communication (IPC)
Inter process communication (IPC) refers to a set of mechanisms that the operating system must support in order to permit multiple processes to interact amongst each other.
This include mechanisms related to synchronization, coordination and communication.
IPC mechanisms are broadly categorized as either _______-based or _______-based.
________-based IPC mechanisms include sockets, pipes, and message queues.
________-based IPC utilizes shared memory. This may be in the form of unstructured shared physical memory _______or memory mapped _______ which can be accessed by multiple processes.
IPC mechanisms are broadly categorized as either message-based or memory-based.
Message-based IPC mechanisms include sockets, pipes, and message queues.
Memory-based IPC utilizes shared memory. This may be in the form of unstructured shared physical memory pages or memory mapped files which can be accessed by multiple processes.
List 2 broad categories of IPC
message-based
memory-based
List 3 examples of message-based IPC
Message-based IPC mechanisms include sockets, pipes, and message queues.
List 2 examples of memory based IPC
unstructured shared memory pages
memory mapped files
In messaged-based IPC, processes create _______ and then send and receive them.
The operating system is responsible for creating and maintaining the _______ that is used to send these messages.
The OS provides an ________ to the processes so that they can send ___________ via this channel. The processes send/write messages to a _____, and then recv/read messages from a _____.
The channel is responsible for passing the message from one ______ to the other.
In messaged-based IPC, processes create messages and then send and receive them.
The operating system is responsible for creating and maintaining the channel that is used to send these messages.
The OS provides an interface to the processes so that they can send messages via this channel. The processes send/write messages to a port, and then recv/read messages from a port.
The channel is responsible for passing the message from one port to the other.
When we send, the data must be copied from the _______ address space into the __________ channel. When we receive, the data must be copied from the __________ channel into the _______ address space.
Since the OS is required to establish the communication and perform each IPC operation, every send and receive call requires a _______ _____ and a ______ ______.
When we send, the data must be copied from the process address space into the communication channel. When we receive, the data must be copied from the communication channel into the process address space.
Since the OS is required to establish the communication and perform each IPC operation, every send and receive call requires a system call and a data copy.
A request-response interaction between two processes requires a total of ______________________ and ________________________
These overheads are one of the negatives of message-based IPC.
A request-response interaction between two processes requires a total of four user/kernel crossings and four data copying operations. These overheads are one of the negatives of message-based IPC.
List one disadvantage of message-based IPC
Since the OS is required to establish the communication and perform each IPC operation, every send and receive call requires a system call and a data copy. When we send, the data must be copied from the process address space into the communication channel. When we receive, the data must be copied from the communication channel into the process address space.
This means that a request-response interaction between two processes requires a total of four user/kernel crossings and four data copying operations. These overheads are one of the negatives of message-based IPC.
List one advantage of message-based IPC
One of the positives of this approach is its relative simplicity.
The OS kernel will take care of all of the operations regarding channel management and synchronization.
How many processes can communicate via a pipe? Explain.
Pipes are characterized by two endpoints, so only two processes can communicate via a pipe.
There is no notion of a message with pipes; instead, there is just a stream of bytes pushed into the pipe from one process and read from the pipe by the other process.
(even though pipes are an example of ‘message-based’ IPC …)
The following is an example of which type of IPC?
cat /some/really/large/file | grep “needle in a haystack”
a pipe
Pipes are characterized by _____ ________, so only two processes can communicate via a pipe.
There is no notion of a message with pipes; instead, there is just a ________ of ________ pushed into the pipe from one process and read from the pipe by the other process.
Messages queues understand the notion of messages that they can deliver. A sending process must submit a _________ __________ message to the channel, and then the channel can deliver this message to the receiving process.
Pipes are characterized by two endpoints, so only two processes can communicate via a pipe.
There is no notion of a message with pipes; instead, there is just a stream of bytes pushed into the pipe from one process and read from the pipe by the other process.
Messages queues understand the notion of messages that they can deliver. A sending process must submit a properly formatted message to the channel, and then the channel can deliver this message to the receiving process.