CS FundamentalsVery hardGATE CS (PYQ pattern)
With 3 frames (initially empty) the reference string is 2, 5, 3, 6, 2, 5, 4, 2, 4, 2, 1, 2, 5, 6, 6, 1, 2, 3, 6, 3, 4, 4. The clock (second-chance) algorithm sets a page's reference bit on load and on every hit, and on a fault sweeps from the hand clearing set bits until it finds a clear one, replacing it and advancing the hand one step. By how many faults does plain FIFO exceed clock?
- A. 4
- B. 3
- C. 2
- D. 5
Correct answer: B. 3
FIFO gives 16 faults and clock gives 13: the reference bit lets clock keep re-used pages that FIFO would evict in arrival order, so the difference is 3.
More Operating Systems questions
- A file of 100,000 bytes is stored on a disk with 512-byte blocks. Under linked allocation each block holds a 4-byte next-pointer and 508…
- A 2^40-byte disk uses 4 KB blocks. Free space can be tracked either by a bitmap (1 bit per block) or by a plain list of free block…
- A 10,000 RPM disk has an average seek time of 5 ms and a sustained transfer rate of 100 MB/s (1 MB = 10^6 bytes). It serves a stream of…
- A one-slot buffer uses semaphores mutex = 1, empty = 1, full = 0. The producer runs twice: wait(mutex); wait(empty); print p…
- Five processes with CPU bursts 5, 12, 3, 9 and 7 ms all arrive at time 0 in that order. Context switches are free. Among the quanta 2, 4…
- A 32-bit machine uses two-level paging with 10 + 10 + 12 address bits. For the running process, root-table entries 3 and 0x2FF are valid…