DOC PREVIEW
Duke CPS 210 - Message Passing

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Message-Passing&Remote Procedure Call2Interprocess Communication -Messages• Assume no explicit sharing of data elements in the address spaces of processes wishing to cooperate/communicate.• Essence of message-passing is copying(although implementations may avoid actual copies whenever possible). • Problem-solving with messages - has a feel of more active involvement by participants.3Issues• System calls for sending and receiving messages with the OS(s) acting as courier.– Variations on exact semantics of primitives and in the definition of what comprises a message.• Naming - direct (to/from pids), indirect (to distinct objects - e.g., mailboxes, ports, sockets)– How do unrelated processes “find” each other?• Buffering - capacity and blocking semantics.• Guarantees -in-order delivery? no lost messages?4Send and Receive5Client / Serverserver->6Example: Time Service7Example: Time Service via Messages8Client / Server with Threads9UNIX Sockets for Client/ Server Message PassingServer1. Create a named socketsyscalls:sfd = socket(…)bind (sfd, ptr,len)2. Listen for clientslisten(sfd,numpend)4. Connection made and continue listeningcfd=accept(sfd, …)5. Exchange datawrite(cfd, …)6. Done: close(cfd);7. Really done: close(sfd);Client3. Create unnamed socket & ask for connectionsyscalls:cfd=socket(…)err=connect(cfd, ptr, …)5. Exchange dataread(cfd, …)6. Done: close(cfd);namenameIn a child process of server10Hiding Message-Passing: RPC18Example: Time Service via RPC19What’s Really Going On20RPC


View Full Document
Download Message Passing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Message Passing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Message Passing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?