CS FundamentalsVery hardGATE CS (PYQ pattern)
LFU replacement with 3 frames (initially empty): the victim is the resident page with the smallest reference count since it was loaded, ties broken in favour of evicting the page loaded EARLIEST; counts restart at 1 when a page is reloaded. Reference string: 4, 5, 2, 1, 2, 1, 2, 2, 3, 3, 1, 5, 5, 3, 1, 3, 5, 3, 5, 1. How many page faults occur?
- A. 6
- B. 10
- C. 9
- D. 12
Correct answer: B. 10
LFU yields 10 faults; LRU on the same string would give 6 (LFU keeps old frequently used pages that are no longer needed).
More Operating Systems questions
- Working-set window Δ = 5 references: WS(t) is the set of distinct pages among the 5 most recent references up to and including time t…
- Semaphores x = 0, y = 0. P1: print a; signal(x); wait(y); print b. P2: wait(x); print c; signal(y); print d. P3: print e. All three start…
- A Unix file system uses 4 KB blocks, 4-byte pointers and inodes with 12 direct pointers, one single-, one double- and one triple-indirect…
- Eight disks can be arranged as RAID 1+0 (4 mirrored pairs, striped together) or as RAID 0+1 (two 4-disk stripe sets, the second mirroring…
- Assume every fork() succeeds (it returns a non-zero value in the parent and 0 in the child) and each process prints X once when it reaches…
- Assume every fork() succeeds and output is unbuffered. int main(void) { int i; for (i = 0; i < 3; i++) { if (fork() == 0 && fork() == 0)…