IPC with Message PassingInter-process Communication (IPC) Process interaction that require the satisfaction of two fundamental requirements: synchronization and communication Processes need to be synchronized to enforce mutual exclusion. Communication: cooperating process need to exchange information Message passing2Message Passing Enforce mutual exclusion Exchange informationsend (destination, message)receive (source, message)3Design issues4• Synchronization• Type of Addressing• Format of message• Queuing disciplineSynchronization Sender and receiver may or may not be blocking (waiting for message) Blocking send, blocking receive Both sender and receiver are blocked until message is delivered Called a rendezvous5Synchronization Nonblocking send, blocking receive Sender continues on Receiver is blocked until the requested message arrives Nonblocking send, nonblocking receive Neither party is required to wait6Addressing Direct addressing Send primitive includes a specific identifier of the destination process Receive primitive could know ahead of time from which process a message is expected Receive primitive could use source parameter to return a value when the receive operation has been performed7Addressing Indirect addressing Messages are sent to a shared data structure consisting of queues Queues are called mailboxes One process sends a message to the mailbox and the other process picks up the message from the mailbox8S1SnR1RnMailboxS1SnR1Port Figure 5.18 Indirect Process Communication(b) Many to oneS1R1Port S1(a) One to one(d) Many to manyR1RnMailbox(c) One to many9Message
View Full Document