CS FundamentalsVery hardIBM · Deloitte pattern
Processes (arrival, burst, priority — a smaller number means higher priority): P1 (arrival 0, burst 5, priority 1), P2 (arrival 2, burst 2, priority 3), P3 (arrival 4, burst 9, priority 2), P4 (arrival 5, burst 4, priority 4), P5 (arrival 8, burst 3, priority 2). Preemptive priority scheduling is used. At what time does P5 complete, and what is the average response time (first time on the CPU minus arrival) over all processes?
- A. P5 completes at 17; average response time 8.2 ms
- B. P5 completes at 15; average response time 6.2 ms
- C. P5 completes at 17; average response time 7.2 ms
- D. P5 completes at 18; average response time 7.2 ms
Correct answer: C. P5 completes at 17; average response time 7.2 ms
Simulating with a preemption check on every priority change gives completion times P1 5, P3 14, P5 17, P2 19, P4 23 and response times (first run − arrival) P1 0, P2 15, P3 1, P4 14, P5 6, averaging 7.2 ms. Treating the scheme as non-preemptive would move P5's completion time.
More Operating Systems questions
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 5), P2 (arrival 2, burst 2), P3 (arrival 4, burst 9), P4 (arrival 5, burst 4), P5…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 9), P2 (arrival 2, burst 3), P3 (arrival 3, burst 4), P4 (arrival 7, burst 6). They…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 9), P2 (arrival 2, burst 3), P3 (arrival 3, burst 4), P4 (arrival 7, burst 6)…
- Processes (arrival, burst, priority — a smaller number means higher priority): P1 (arrival 0, burst 9, priority 1), P2 (arrival 2, burst…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 9), P2 (arrival 2, burst 3), P3 (arrival 3, burst 4), P4 (arrival 7, burst 6). They…
- Processes (arrival, burst) in ms: P1 (arrival 0, burst 9), P2 (arrival 2, burst 3), P3 (arrival 3, burst 4), P4 (arrival 7, burst 6)…