StreakPeaked· Practice

ExamsGATETechnical

Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time. A (0, 10), B (2, 6), C (4, 3), and D (6, 7). Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-preemptive Shortest Job First (N-P-SJF) CPU scheduling algorithms are applied to the processes?

  1. SRTF = 6, N-P-SJF = 7
  2. SRTF = 6, N-P-SJF = 7.5
  3. SRTF = 7, N-P-SJF = 7.5
  4. SRTF = 7, N-P-SJF = 8.5

Correct answer: SRTF = 6, N-P-SJF = 7.5

Solution

The correct option indicates that under the preemptive SRTF scheduling, the average waiting time is minimized to 6 because processes are executed based on their remaining burst time, allowing shorter jobs to interrupt longer ones. In contrast, the non-preemptive SJF scheduling results in an average waiting time of 7.5, as processes are executed in the order of their burst times without preemption, leading to longer waiting times for some processes.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →