Computer Science, asked by vamvamtut1442, 11 days ago

In this problem you are to compare reading a file using a single-threaded file server and a multithreaded server. It takes 12 msec to get a request for work, dispatch it, and do the rest of the necessary processing, assuming that the data needed are in the cache. If a disk operation is needed, as is the case one-third of the time, an additional 75 msec is required, during which time the thread sleeps. How many requests/sec can the server handle (a) if the server is single threaded (b) if it is multithreaded assuming that whenever a thread is stuck waiting for data another thread executes?

Answers

Answered by chaitaliganguly207
0

Answer:

In the single-threaded case, the cache hits take 12 msec and cache misses take 87 msec. The weighted average is 2/3 × 12 + 1/3 × 87. Thus, the mean request takes 37 msec and the server can do about (1000/37=27) per second.

For a multithreaded server, all the waiting for the disk is overlapped, so every request takes 12 msec, and the server can handle (1000/12=83,3333) requests per sec

Similar questions