CS FundamentalsVery hardProduct company interview · GATE level

Processes (arrival, burst, priority; a smaller number means higher priority): A (0, 9, 3), B (1, 4, 1), C (3, 6, 4), D (5, 2, 2), E (8, 5, 2). Preemptive priority scheduling is used. What is the average response time (first run minus arrival) and when does C finish?

  1. A. Average response time 0 ms; C finishes at 26
  2. B. Average response time 3.4 ms; C finishes at 20
  3. C. Average response time 3.4 ms; C finishes at 26
  4. D. Average response time 4.4 ms; C finishes at 26

Correct answer: C. Average response time 3.4 ms; C finishes at 26

A runs 0-1, B (priority 1) preempts and runs 1-5, then D (priority 2, arrived at 5) runs 5-7. A resumes 7-8, E (priority 2) arrives at 8 and preempts A, running 8-13. A finishes 13-20 and C, the lowest priority, runs 20-26. Response times: A 0, B 0, C 20 - 3 = 17, D 0, E 0; average 17/5 = 3.4 ms. Only C ever waits before its first run, and it waits long - the starvation risk of static priorities in miniature.

More Operating Systems questions

Exams that ask this topic