Skip to content
Official PYQ · 1995

GATE CS 1995 Q2.6 — CPU Scheduling

Explain with AI

The sequence __________ is an optimal non-preemptive scheduling sequence for the following jobs which leaves the CPU idle for ________ unit(s) of time.JobArrival TimeBurst Time10.0920.6531.01\small \begin{array}{|c|c|c|} \hline \textbf{Job} & \textbf{Arrival Time} & \textbf{Burst Time} \\ \hline 1 & 0.0 & 9 \\ \hline 2 & 0.6 & 5 \\ \hline 3 & 1.0 & 1 \\ \hline \end{array}

Choose one option
View worked solution

Answer: A

An optimal scheduling sequence is one that minimizes the average turnaround time (TAT). Let's compare the two main non-preemptive scheduling strategies:

Strategy 1: Schedule immediately at t=0t = 0 (No Idle Time)
Since Job 1 is the only job available at t=0t = 0, it must run first. After Job 1 finishes at t=9t = 9, we schedule the remaining jobs using Shortest Job First (SJF): Job 3, then Job 2.

  • Execution sequence: 1→3→21 \rightarrow 3 \rightarrow 2
  • Completion times: C1=9C_1 = 9, C3=10C_3 = 10, C2=15C_2 = 15
  • Turnaround times (TAT=C−ATTAT = C - AT): TAT1=9TAT_1 = 9, TAT3=9TAT_3 = 9, TAT2=14.4TAT_2 = 14.4
  • Average TAT = 9+9+14.43=10.8\frac{9 + 9 + 14.4}{3} = 10.8 units
  • CPU Idle Time = 00 units

Strategy 2: Keep the CPU idle to run shorter jobs first (SJF with Idle Time)
If we keep the CPU idle from t=0t = 0 to t=1.0t = 1.0 to wait for all jobs to arrive, we can execute them in the optimal SJF order: Job 3, then Job 2, then Job 1.

  • Execution sequence: 3→2→13 \rightarrow 2 \rightarrow 1
  • Completion times: C3=2C_3 = 2, C2=7C_2 = 7, C1=16C_1 = 16
  • Turnaround times (TAT=C−ATTAT = C - AT): TAT3=2−1.0=1.0TAT_3 = 2 - 1.0 = 1.0, TAT2=7−0.6=6.4TAT_2 = 7 - 0.6 = 6.4, TAT1=16−0=16.0TAT_1 = 16 - 0 = 16.0
  • Average TAT = 1.0+6.4+16.03=7.8\frac{1.0 + 6.4 + 16.0}{3} = 7.8 units
  • CPU Idle Time = 1.01.0 unit (from t=0t = 0 to t=1.0t = 1.0)

Since Strategy 2 yields a significantly lower average turnaround time (7.8<10.87.8 < 10.8), the optimal sequence is {3,2,1}\{3, 2, 1\} with 11 unit of CPU idle time.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore CPU Scheduling questions