- 2071 Bhadra · 5 marks
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).
| Process | Burst | Priority | Order |
|---|---|---|---|
| P2 | 6 | 0 (highest) | 1st |
| P1 | 4 | 1 | 2nd |
| P3 | 5 | 3 (lowest) | 3rd |
| P2 | P1 | P3 |
0 6 10 15
| Process | Completion | TAT | WT |
|---|---|---|---|
| P1 | 10 | 10 | 10 - 4 = 6 |
| P2 | 6 | 6 | 6 - 6 = 0 |
| P3 | 15 | 15 | 15 - 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)
Related questions
- Preemptive priority scheduling with P4 (6 ms) · Embedded System, chapter 6 · asked 2×
- Non-preemptive priority scheduling (10, 5, 7 ms) · Embedded System, chapter 6 · asked 2×
- Preemptive priority scheduling (4, 10, 5 ms) · Embedded System, chapter 6 · asked 2×
- Priority scheduling (7, 8, 5 ms) with P4 · Embedded System, chapter 6 · asked 2×
- Preemptive SJF/SRT scheduling (10, 5, 7 ms) · Embedded System, chapter 6
- Priority and SJF scheduling with P4 and P5 · Embedded System, chapter 6 · asked 2×
- RR, preemptive priority, preemptive SJF · Operating System, chapter 2
- Preemptive priority and SRTF Gantt · Operating System, chapter 2
- Real-time scheduling; two-processor numerical · Operating System, chapter 2