0
6.8kviews
Consider a system running 10 I/O bound task and one CPU bound task.

Consider a system running 10 I/O bound task and one CPU bound task. Assume that I/O bound issues an I/O operation once for every milisecond of CPU computing and that each I/O operation 10 miliseconds to complete. Also assume that the context switching overhead is 0, 1 milisecond and that all processes are long running task. what is the CPU utilization for round robin schedular when :

(i) the time quantum is 1 milisecond

(ii) the time quantum is 10 miliseconds?

1 Answer
0
1.5kviews

Solution:

(i) the time quantum is 1 milisecond:

Irrespective of which process is scheduled, the scheduler incurs a 0.1 millisecond context-switching cost for every context-switch.

This results in a CPU utilization of, $$\frac{1}{1.1} * 100=91 \%$$

(ii) the time quantum is 10 miliseconds?

The I/O-bound tasks incur a context switch after using up only 1 millisecond of the time quantum.

A CPU bound process can use the full 10 ms time slot, whereas an I/O bound process can have it only for 1 ms because another I/O bound process in the queue will snatch the time from it. So a CPU bound process takes 10 ms.

therefore 10*1.1 + 10.1 (as each I/O-bound task executes for 1millisecond and then incur the context switch task, whereas the CPU-bound task executes for 10 milliseconds before incurring a context switch).

So, the CPU would be utilized for a total of 20 ms out of 21.1 ms. (Total time is 10*1.1 + 10.1=21.1ms).

The CPU utilization is therefore,

$$\frac{20}{21.1} * 100=95 \%$$

Please log in to add an answer.