CS FundamentalsHardGATE CS
With 3 frames, initially empty, the reference string 4, 7, 0, 7, 1, 0, 1, 2, 1, 2, 7, 1, 2, 0, 4, 7 is run under FIFO, LRU and Optimal. How many page faults does each give?
- A. FIFO 9, LRU 8, OPT 7
- B. FIFO 8, LRU 8, OPT 7
- C. FIFO 8, LRU 9, OPT 6
- D. FIFO 8, LRU 9, OPT 7
Correct answer: D. FIFO 8, LRU 9, OPT 7
Simulating gives FIFO 8, LRU 9 and OPT 7. LRU is not always better than FIFO: here it evicts 7 just before 7 is reused and later evicts 1 and 2 before they return, while OPT is always the minimum.
More Operating Systems questions
- A clock (second-chance) algorithm has frames f0–f4 holding P3 (R = 1), P8 (R = 0), P5 (R = 1), P1 (R = 1) and P6 (R = 0). The hand points…
- A system has a TLB lookup of 20 ns, memory access of 100 ns, single-level paging and a TLB hit ratio of 90%, so a reference costs 130 ns…
- A 40-bit virtual address space uses 8 KB pages and 8-byte page-table entries, and every page-table node at every level must fit in exactly…
- Banker's algorithm, resources (A, B, C). Allocation / Max: P0 (1,0,1) / (4,3,2), P1 (2,1,0) / (3,2,2), P2 (0,1,1) / (2,3,3), P3 (1,1,0) /…
- Deadlock detection, resources (A, B, C), Available = (1, 0, 0). Allocation / Request: P1 (0,1,0) / (1,0,0), P2 (1,0,1) / (0,2,0), P3…
- Four processes need at most 3, 4, 5 and 2 units of one resource type and request them one at a time in any order. What is the smallest…