Three processes arrive at time zero with CPU bursts of 16, 20 and 10…

2021

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

Answer: 12Key insight: when all processes arrive at the same time, the non-preemptive shortest-job-first order minimizes average waiting time. Order the CPU bursts from…

Attempted by 239 students.

Show answer & explanation

Correct answer: 12

Key insight: when all processes arrive at the same time, the non-preemptive shortest-job-first order minimizes average waiting time.

  • Order the CPU bursts from shortest to longest: 10 ms, 16 ms, 20 ms.

  • Compute waiting time for each process:

    • Process with 10 ms: waiting = 0 ms.

    • Process with 16 ms: waiting = 10 ms (time taken by the first process).

    • Process with 20 ms: waiting = 10 + 16 = 26 ms.

  • Average waiting time = (0 + 10 + 26) / 3 = 36 / 3 = 12 ms.

Therefore the minimum achievable average waiting time is 12 milliseconds.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…