Consider the following set of processes with the arrival time and length of…

2025

Consider the following set of processes with the arrival time and length of CPU Burst time given in milli-seconds (ms):
 

Process

Arrival Time

Burst Time

P₁

0

5

P₂

2

3

P₃

2

2

P₄

5

3

P₅

6

1


When we apply Shortest Job First (SJF) scheduling Policy/algorithm, Process (P₂) faces partial starvation and waits for the longer time to execute. Which one of the following algorithms addresses this problem?

  1. A.

    Round Robin

  2. B.

    Priority

  3. C.

    Highest Response ratio Next

  4. D.

    Least Completed next

Attempted by 257 students.

Show answer & explanation

Correct answer: C

Answer: Highest Response ratio Next

Key idea: compute the response ratio for each waiting process to decide who runs next.

Response ratio = (waiting time + service time) / service time

  • At time 0: only P1 has arrived, so P1 runs from 0 to 5.

  • At time 5: P2 and P3 are waiting (both arrived at time 2). Waiting time = 3 for each. Response ratios:

    P2: (3 + 3) / 3 = 2.0; P3: (3 + 2) / 2 = 2.5 → P3 has higher response ratio, so P3 runs from 5 to 7.

  • At time 7: P2, P4 (arrived at 5) and P5 (arrived at 6) are waiting. Compute waiting times and response ratios:

    Waiting times at time 7: P2 = 5, P4 = 2, P5 = 1.

    Response ratios: P2 = (5 + 3) / 3 ≈ 2.67; P4 = (2 + 3) / 3 ≈ 1.67; P5 = (1 + 1) / 1 = 2.0 → P2 is chosen and runs from 7 to 10.

  • After P2 finishes at 10, remaining processes are scheduled in order of their response ratios at each decision point.

Why this fixes SJF partial starvation: Highest Response Ratio Next favors short jobs but increases the effective priority of long-waiting jobs by including waiting time in the response ratio. That prevents a longer job (like the described process that waited under SJF) from being repeatedly postponed — its response ratio grows until it is selected.

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

Explore the full course: Mppsc Assistant Professor