Lecture 8 Flashcards
Reasons for Process Cooperation
1)Information Sharing
2) Computation Speedup(Processes are broken down and assigned to different cores resulting in computation speedup)
3)Modularity
What are the two models of interprocess communication?
1) Message Passing
2)Shared Memory
When is message passing useful?
- Message passing is helpful in exchanging smaller amounts of data.
- It’s easier to implement in a distributed system.
Which method of communication is faster and why?
Shared memory is faster because once established all accesses are treated as routine memory accesses and no assistance from the kernel is required. On the other hand, message passing is implemented using system calls which involve kernel intervention.
What is shared-memory in IPC?
A mechanism that allows processes to communicate and synchronize their actions by sharing the same address space.
A shared-memory region resides in the address space of the process creating the shared-memory segment.
What are two types of messages?
- Variable-sized messages
- Fixed-sized messages
Define variable-sized messages.
The size of the messages can be varied. They require a more complex system-level implementation, but the programming task becomes simpler.
Define fixed-sized messages.
The size of the messages is fixed. The system-level implementation is straightforward but the programming task becomes more difficult.
How a communication link is established in message-passing systems?
- Direct or indirect communication
- Synchronous or asynchronous communication
- Automatic or explicit buffering
What is direct communication?
Each process that wants to communicate must explicitly name the recipient or sender of the communication in this way:
1) an automatic link is established
2) Link is only between two processes.
3) There is only one link between the two processes
What is indirect communication?
The processes that want to communicate send messages to and receive from mailboxes.
1) A link is established between a pair of processes only if both members of the pair have a shared mailbox.
2) A link may be associated with more than two processes.
3)A number of different links may exist between a pair of processes, with each link corresponding to one mailbox.