From user ok lets make this a bit more interesting

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ? RPC described so far: Client: calls local procedure Server: loop Wait for incoming request Execute request But if there are multiple clients, server will stall waiting for the client Perhaps ok if single CPU, and requests are short What if request goes to the file system/disk? (e.g., fetch page) One approach (Apache): use threads and TCP [a thread is an asynchronous procedure call] Wait for incoming connection (fd = socket accept) Fork thread to handle requests from that client (fd) Each server thread has loop Wait for incoming request (read fd) Execute request Reply (write fd) Alternate approach: events Server: loop Get next event Process event (send request to file system, get completion notification from file system, get command from user) OK, let’s make this a bit more interesting Google instant: Type command, get the search result, but you can keep typing, and it updates as it goes. Does it do an RPC for every character? (sort of: unlike a procedure call, it doesn’t wait for the reply. You can k...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online