CS FundamentalsVery hardGATE CS
Reference string: 0, 4, 1, 4, 2, 4, 3, 4, 2, 4, 0, 4, 1, 4, 2, 4, 3, 4. How many page faults does LRU give with 2, 3, 4 and 5 frames respectively (initially empty)?
- A. 10, 10, 8, 5
- B. 14, 11, 10, 5
- C. 10, 9, 8, 5
- D. 10, 9, 7, 5
Correct answer: C. 10, 9, 8, 5
Page 4 is referenced every other time, so it always stays; the other pages cycle 0, 1, 2, 3. With 5 frames everything fits (only 5 cold faults). With k frames, page 4 always occupies one (it is never least recent), so k − 1 frames serve the cycle of the other pages, and LRU on a cycle longer than its frames faults on nearly every such reference. Counts: 10, 9, 8, 5.
More Operating Systems questions
- TLB access 2 ns (looked up first), memory access 50 ns, two-level page table, TLB hit ratio 98%. A fraction 10⁻⁵ of ALL accesses…
- A machine has 57-bit virtual addresses (5-level paging style), 4 KB pages and 8-byte page-table entries, with every page table fitting in…
- A system has 46-bit virtual addresses, 16 KB pages and 4-byte PTEs; each page table must fit in one page. How many levels of page tables…
- Segment table (base, length): S0 (219, 600), S1 (2300, 14), S2 (90, 100), S3 (1327, 580), S4 (1952, 96). What are the physical addresses…
- How many times are 'c' and 'p' printed in total? (Every fork() succeeds.) c int main() { for (int i = 0; i < 3; i++) { if (fork() == 0)…
- How many times is each letter printed? (Every fork() succeeds.) c int main() { if (fork() == 0) { if (fork() == 0) printf("A"); else…