GATE - 2003 | OS | A uni-processor computer system only has two processes, both of

GATE - 2003 | OS | A uni-processor computer system only has two processes, both of
Posted on 23-02-2022

GATE - 2003 [Operating System]

Questions:

A uni-processor computer system only has two processes, both of which alternate 10 ms CPU bursts with 90 ms I/O bursts. Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization (over a long period of time) for this system?

A

First come first served scheduling

B

Shortest remaining time first scheduling

C

Static priority scheduling with different priorities for the two processes

D

Round robin scheduling with a time quantum of 5 ms

   

Solution:

Option (D) is Correct.

We have two processes P and Q. These process have 10ms CPU burst time and 90ms I/O bursts.


(i) FCFS:
0-10: Process 1 can execute
10-20: Process 2 can execute
100-110: Process 1 Terminate
110-120: Process 2 Terminate
CPU utilization = 20/100 [In every 100ms it utilizes]
=20%


(ii) SRTF: can process P and Q same as FCFS
then CPU utilization = 20%


(iii) Round robin: with TQ-5
0-5: Process P1
5-10: Process P2
10-15: Process P1
15-20: Process P2
105-110: Process P1
110-115: Process P2
CPU utilization = 20/105 = 19.5

Thank You