Skip to main content

Preemptive priority scheduling (4, 6, 5 ms)

Short answer

Using preemptive priority scheduling, execution order P2, P1, P3 gives waiting times: P1=6 ms, P2=0 ms, P3=10 ms; turnaround times: 10, 6, 15 ms. Average waiting time = 5.33 ms, average turnaround time = 10.33 ms.

Three processes with process IDs P1, P2, P3 with estimated completion times 4, 6, 5 milliseconds and priorities 1, 0, 3 respectively enter the ready queue together. Calculate the waiting time and turn-around-time for each process and the average waiting time and turn around time in preemptive priority based scheduling algorithm, by assuming zero is the highest priority and three is the lowest priority.

Preemptive priority scheduling (0 = highest): the CPU is always given to the ready process with the highest priority. All processes arrive at t = 0, so no pre-emption actually occurs. WT = TAT - burst; TAT = completion - arrival (0).

ProcessBurstPriorityOrder
P260 (highest)1st
P1412nd
P353 (lowest)3rd
 |    P2    |   P1   |    P3     |
 0          6        10          15
ProcessCompletionTATWT
P1101010 - 4 = 6
P2666 - 6 = 0
P3151515 - 5 = 10

Average WT = (6 + 0 + 10) / 3 = 16 / 3 = 5.33 ms Average TAT = (10 + 6 + 15) / 3 = 31 / 3 = 10.33 ms

✓ Answer checked by Claude Opus 5.5 (high effort)

All Embedded System chapter 6 questions →