A client makes remote method invocations to a server. The client takes 5 millise
ID: 3701219 • Letter: A
Question
A client makes remote method invocations to a server. The client takes 5 milliseconds to compute the arguments for each request, and the server takes 10 milliseconds to process each request. The local operating system processing time for each send or receive operation is 0.5 milliseconds, and the network time to transmit each request or reply message is 3 milliseconds. Marshalling or unmarshalling takes 0.5 milliseconds per message. Calculate the time taken by the client to generate and return from two requests: (i) if it is single-threaded; (ii) if it has two threads that can make requests concurrently on a single processor.
e Show vour formula and intermediate steps . The single-threaded means that sending a second request should be followed after receiving the reply of a first request . The server can process a single request at a time. » Assume error free network.Explanation / Answer
Please find my answer:
Answer:
(i) time per call = calc. args + marshal args + OS send time + message transmission +
OS receive time + unmarshall args + execute server procedure + marshall results + OS
send time + message transmission + OS receive time + unmarshal args
= 5 + 4*marshal/unmarshal + 4*OS send/receive + 2*message transmission + execute
server procedure
= 5+ 4*0.5 + 4*0.5 + 2*3 + 10 ms = 5 + 2 + 2 + 6 + 10 = 25ms.
Time for two calls = 50 ms.
(ii) threaded calls:
client does calc. args + marshal args + OS send time (call 1) = 5 + .5 = .5 = 6
then calc args + marshal args + OS send time (call 2) = 6
= 12 ms then waits for reply from first call
server gets first call after
message transmission + OS receive time + unmarshal args = 6 + 3 + .5 + .5
= 10 ms, takes 10 + 1 to execute, marshal, send at 21 ms
server receives 2nd call before this, but works on it after 21 ms taking
10 + 1, sends it at 32 ms from start
client receives it 3 + 1 = 4 ms later i.e. at 36 ms
(message transmission + OS receive time + unmarshal args) later
Time for 2 calls = 36 ms.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.