Skip to main content

GATE CSE 2021Operating System › CPU SchedulingVerified

GATE CSE 2021 PYQ: Three processes arrive at time zero with CPU \text{CPU} CPU bursts of 16 , 20 16,\;20 16 , 20 and 10 10 10…

Three processes arrive at time zero with CPU\text{CPU} bursts of 16,  2016,\;20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU\text{CPU} bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _____________ milliseconds.

    Answer

    12

    Approach

    With all processes available at time 0 and known burst lengths, the non-preemptive scheduling policy that minimizes average waiting time is Shortest Job First (SJF). Schedule the processes in increasing CPU burst order: 10, 16, 20.

    Non-preemptive SJF minimizes average waiting time when all jobs arrive together. The waiting times are 0, 10, and 26 ms, so the minimum average waiting time is 12 ms.

    Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.