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

 

Process

Burst Time

Priority

P₁

5

3

P₂

3

1

P₃

2

5

P₄

3

4

P₅

1

2


Calculate the average response time for these processes with non preemptive priority Scheduling algorithm?
Priority of the processes are as follows and consider that all the processes came at zero (0) time. (Note: low numbers represent high priority).

  1. A.

    5.6 ms

  2. B.

    5.2 ms

  3. C.

    4.7 ms

  4. D.

    3.8 ms

Attempted by 199 students.

Show answer & explanation

Correct answer: A

Key insight: All processes arrive at time 0 and a lower priority number means higher priority. For non-preemptive priority scheduling, schedule processes in increasing priority number.

  • Schedule order by priority: P2 (priority 1), P5 (priority 2), P1 (priority 3), P4 (priority 4), P3 (priority 5).

Compute start times and response times (arrival = 0 so response time = start time):

  • P2: starts at 0 ms → response time = 0 ms (burst 3 ms).

  • P5: starts at 3 ms → response time = 3 ms (burst 1 ms).

  • P1: starts at 4 ms → response time = 4 ms (burst 5 ms).

  • P4: starts at 9 ms → response time = 9 ms (burst 3 ms).

  • P3: starts at 12 ms → response time = 12 ms (burst 2 ms).

Sum of response times = 0 + 3 + 4 + 9 + 12 = 28 ms.

Average response time = (28 ms) / 5 = 5.6 ms.

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

Explore the full course: Mppsc Assistant Professor