CS FundamentalsVery hardGATE CS

Reference string 1, 2, 3, 1, 4, 5, 1, 6, 2, 1, 3, 4 with 3 frames, initially empty. The clock (second-chance) algorithm sets a page's reference bit to 1 when it is loaded or referenced, and the hand moves past a frame after replacing it. How many faults occur under clock, FIFO and LRU respectively?

  1. A. 9, 10, 9
  2. B. 10, 10, 9
  3. C. 10, 9, 9
  4. D. 9, 10, 10

Correct answer: B. 10, 10, 9

Simulation gives 10 faults for clock: the hit on 1 at time 4 is wiped out when the hand sweeps all three set bits before replacing it. FIFO also faults 10 times, while LRU, which keeps 1 longer, faults 9 times.

More Operating Systems questions

Exams that ask this topic