CS FundamentalsHardGATE CS
A loop references pages 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 with 3 frames, initially empty. How many faults occur under FIFO, LRU and OPT?
- A. 12, 12, 8
- B. 12, 9, 6
- C. 9, 12, 6
- D. 12, 12, 6
Correct answer: D. 12, 12, 6
A cyclic loop one page larger than memory defeats FIFO and LRU: each evicts exactly the page needed next, so all 12 references fault. OPT evicts the page used farthest ahead and faults only 6 times (4 cold plus 2).
More Operating Systems questions
- Banker's algorithm, resources (A, B, C). Available = (1, 1, 2). Allocation / Max: P0 (1,0,1)/(2,1,2), P1 (2,1,0)/(3,2,2), P2…
- How many times is x printed? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { fork(); fork() && fork()…
- How many numbers are printed, and what is their sum? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { for…
- Which letters are printed, and how many times each? (Every fork() succeeds, and each print is an unbuffered write.) c int main() { if…
- Periodic tasks T1 (execution 2, period 5) and T2 (execution 4, period 7), deadlines equal to periods. Which statement is correct?
- Each process spends 50% of its time waiting for I/O, independently of the others. Under the simple model CPU utilisation = 1 − pⁿ, what is…