in Operating System edited by
2,558 views
0 votes
0 votes
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 block 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 if it is single threaded? If it is multithreaded?
in Operating System edited by
by
2.6k views

1 Answer

0 votes
0 votes
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

Related questions