ITPEC FE Morning October 2022 Question 18

Source exam: ITPEC FE Morning October 2022Topic: Computer Systems & Hardware

ITPEC FE Morning October 2022 — Question 18 of 80

Preemptive Priority Scheduling — CPU idle time — simulate a timeline with priority-based CPU allocation and parallel I/O.

Given three tasks with priorities and sequences CPU → I/O → CPU:

  • A (High): CPU(3) → I/O(5) → CPU(2)
  • B (Medium): CPU(2) → I/O(6) → CPU(2)
  • C (Low): CPU(1) → I/O(5) → CPU(1)

Rules:
- CPU goes to the highest-priority ready task (preemptive)

- I/O runs in parallel with CPU (separate device)

- No OS overhead, no I/O contention

Timeline:

  • t=0–3: A runs CPU(3); B, C wait
  • t=3–5: A starts I/O(5); B runs CPU(2)
  • t=5–6: B starts I/O(6); C runs CPU(1)
  • t=6–8: C starts I/O(5); CPU idle (2ms) — all tasks on I/O
  • t=8–10: A returns from I/O, runs CPU(2) → A done
  • t=10–11: CPU idle (1ms) — B and C still on I/O
  • t=11–13: B returns, runs CPU(2) → B done; C also returns but waits
  • t=13–14: C runs CPU(1) → C done

CPU idle = 2 + 1 = `3` ms

Why not others:
- (a) 2 — misses the idle gap at t=10–11

- (c) 4 — overcounts idle time

- (d) 5 — likely ignored parallel I/O

Key rule: I/O device operates independently from CPU. Track each task's I/O return time to know when it becomes ready for its next CPU burst.

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.