ITPEC FE Morning October 2020 Question 18
ITPEC FE Morning October 2020 — Question 18 of 80
Preemptive Priority Scheduling — determine the Gantt chart for three tasks with different priorities.
Given tasks arriving at t=3:
- A (High): CPU(2) → I/O(2) → CPU(2)
- B (Medium): CPU(3) → I/O(5) → CPU(2)
- C (Low): CPU(2) → I/O(2) → CPU(3)
Step-by-step scheduling:
- •
t=3–5: A runs CPU(2). B, C wait. - •
t=5–7: A goes to I/O(2). B gets CPU (next highest priority), runs 2 of 3 ms. - •
t=7: A returns from I/O, needs CPU(2). A preempts B (higher priority). - •
t=7–9: A runs CPU(2) → A complete at t=9. B waits (1 ms CPU left). C waits. - •
t=9–10: B resumes CPU (1 ms remaining). C still waits.
Why not others:
- (b) — does not correctly preempt B when A returns from I/O
- (c) — shows A starting with I/O instead of CPU, violating its operation sequence
- (d) — same error as (c), A incorrectly starts with I/O
Key rule: In preemptive priority scheduling, a higher-priority task that becomes ready immediately takes the CPU from a lower-priority running task.
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.