753 views
2 votes
2 votes
Consider a CPU running 10 i/o bound task and 1 CPU bound task. Assume that i/o bound task issue an i/o operation once for every millisecond of CPU computing and that each i/o operation takes 10 ms to complete. Also, assume that context switching overhead is 0.1 ms and that all processes are lng running tasks. What is the utilization (in %) for a round-robin scheduler when the time quantum is 10ms.

2 Answers

Best answer
4 votes
4 votes
There are 10 I/O bound task and 1 CPU bound task. It is given that time quantum is 10ms. As after every 1 ms each I/O bound task goes for performing I/O for the next 10ms, so 10*(1+0.1)=10*1.1=11ms time is spent by the 10 I/O bound task in CPU computation(including context switch time) and the 1 CPU bound task executes for a time quantum of 10ms, so total time spent by the cpu bound task= 10+0.1=10.1ms

hence out of total 11+10.1= 21.1ms, for (10*1)+10= 20ms CPU is utilized and the remaining time is spent in context switches.

Therefore, CPU utilization= (20/21.1)*100= 94.78%
selected by
0 votes
0 votes
Though time quantum is 10ms, but I/O bound process will only occupy 1ms of cpu and then go to block state as it need I/O, and thus there is 0.1ms of context switching.

So total time taken by I/O bound process will be= 10*1

But CPU bounded process uses its whole 10ms of time slice and 0.1ms of switching. So it takes total time of 1*10=10ms

And total context switching time=11*0.1=1.1ms

Therefor total time taken=10+10+1.1=21.1ms

and time for which cpu was busy/doing execution=10*1+1*10=20

CPU utilisation=(20/21.1)*100=94%

Related questions

0 votes
0 votes
0 answers
1
Dknights asked Jan 19
151 views
Can someone please explain how to calculate TLB size?
0 votes
0 votes
1 answer
2
Dknights asked Oct 6, 2023
263 views
if there is a deadlock then mutual exclusion or progress or bound wait or circular wait can be there.but if there is no mutual exclusion or any one of the other propertie...
1 votes
1 votes
1 answer
3
yuvrajeyes asked Dec 31, 2022
235 views
Since Dealock No Progressthen Does Progess No Deadlockbcoz contrapositive should be true.
0 votes
0 votes
2 answers
4
shivang1234 asked Jan 19, 2022
622 views
In round-robin if one process finishes its time quantum and at the same time another process enters the system so which one will enter the ready queue first?