edited by
2,812 views
2 votes
2 votes
in a round robin scheduling s represents the time of context switching, q represents the time quantum and r represents the average time the process runs before blocking on i/o.

if s<q<r, then cpu efficiency?

a )q/q+s

b) q/r+s

c) r/r+s

d) qr/r+s
edited by

4 Answers

3 votes
3 votes
let assume that the processes takes n quantums so in normal scheduling it will be Nq

now in the rr scheduling it will be N(q+s).....

so the efficiency will be Nq/(N(q+s))=q/q+s

 

option a
2 votes
2 votes
The process needs to spend 'r' units of time in CPU. But since this is a question of round robin scheduling, it has to switch between run and ready state after spending every 'q' units in CPU. Suppose it has do 'n' switches. So in order to complete 'r' units, r=nq gives n=(r/q) no. of switches.

Now, after every 'q' comes the time spent on context switching which is 's'. So n*s times wasted for this purpose.

Time utilized in CPU is 'r' (or nq, its the same thing).

Total time needed for this process to complete is r+ns (or you can write n(q+s) ).

CPU utilization is = r/(r+ns)

Replace n with r/q and you will get Option A.
0 votes
0 votes
i think answer should be (c)

as r will include quantum time also because watever time process will execute it will be quantum time only
0 votes
0 votes
Answer is A because, for every useful time $q$ spent by CPU, it is spending $q+s$ time in total, ie in total q+s time units CPU is doing useful work for only q time units. therefore efficiency is $q/q+s$. Same concept as of networks.

Related questions

1 votes
1 votes
1 answer
3
iarnav asked Jan 12, 2022
402 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.