ITPEC FE Subject A April 2025 Question 14
ITPEC FE Subject A April 2025 — Question 14 of 60
Preemptive Priority Scheduling — calculate average waiting time.
Given four processes with arrival times, burst times, and priorities (lower number = higher priority), simulate preemptive scheduling:
Execution timeline:
- t=0–2: P1 runs (priority 2, only process)
- t=2–3: P2 arrives (priority 1), preempts P1
- t=3–9: P2 done, P1 resumes (6 ms remaining)
- t=9–11: P3 runs (priority 3, next highest)
- t=11–14: P4 runs (priority 4)
Waiting time = completion_time − arrival_time − burst_time:
- P1: 9 − 0 − 8 = 1
- P2: 3 − 2 − 1 = 0
- P3: 11 − 4 − 2 = 5
- P4: 14 − 6 − 3 = 5
Average = (1 + 0 + 5 + 5) / 4 = 2.75
Key rule: In preemptive scheduling, a running process is interrupted when a higher-priority process arrives. Waiting time excludes the time a process is actually executing.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.