1,622 views
2 votes
2 votes

We are given a computer system consisting of a CPU and a disk. We are told that, each user request has a compute time of 80 msec and an average generates 10 disk requests. We are further told that, the service time at the disk is 10 msec. What is the maximum number of user requests that can be satisfied per second?

3 Answers

4 votes
4 votes

Ans.  5.555 user reqest per second

Each User request requires 80 m sec of CPU Time and 10 disk request as IO Time.

total time required for a process = CPU Time + IO Time

                                                   = 80 ms + 10 disk request * ( 10 ms per disk request )

                                                  = 180 ms

Number of process per second = 1 sec / 180 ms = 1/ (180 * 10-3 ) = 5.555

1 votes
1 votes

First process completes cpu at 80, cpu assigned to second and first process  do io, second process completes cpu at 160, first process completes io  at 180

Similarly 9 th process completes io at 980

Process 10 to 12 cannot complete io but ll finish cpu time  at 960

Coz only one disk  multiple io request at same time to same disk not available,  disk will have an io queue where processes ll be lined up

Ans must be 9

edited by
0 votes
0 votes

The answer is 9

If P1 comes and after 80 ms goes for I/O, it will complete its I/O at 180ms. 

Now after 80ms, CPU takes on P2. After 160 ms CPU takes on P3. This goes on and on, till P12, whose CPU burst will be over at 960ms. We won't consider processes after that as we have to find out how many within a second. 

But in this time of 1000 ms we have to find out, how many processes completed their I/O?

So after 80ms, I/O of P1 will start, which will be completed at 180 ms. Then P2, which will be completed at 280 ms. This will go on till P9, which will be completed at 980 ms. 

This calculation can also be done by forming an equation. If a Gantt Chart of I/O is drawn, starting at t=80 ms and I/O at every 100 ms, 

80+ x(100) <=1000
x=9 (integer value)

 

 




 

edited by

Related questions

1 votes
1 votes
1 answer
2
iarnav asked Jan 12, 2022
402 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
8 votes
8 votes
6 answers
4