CS FundamentalsVery hardGATE CS

Processes on one CPU, Round Robin quantum 2: A arrives at 0 and needs CPU 3, then I/O 2, then CPU 1; B arrives at 1 and needs CPU 4. A process returning from I/O joins the tail of the ready queue; a process arriving at the same instant a quantum ends is queued before the preempted process. When does A finish?

  1. A. 7
  2. B. 5
  3. C. 4
  4. D. 8

Correct answer: D. 8

A 0–2 (B arrived at 1, queue: B, A). B 2–4 (queue: A, B). A 4–5 finishes its first burst and starts I/O 5–7. B 5–7 finishes at 7. A returns at 7 and runs 7–8, finishing at 8. 7 is B's finish, 5 is when A starts its I/O, and 4 is A's total CPU need.

More Operating Systems questions

Exams that ask this topic