CS FundamentalsHardGATE CS (PYQ pattern)
Which of the following statements about fork() with copy-on-write are correct? I. Right after fork, parent and child map the same physical frames, marked read-only in both page tables. II. A write to a shared page raises a protection fault whose handler copies the page. III. Demand-zero pages let a fresh heap be allocated without any disk read. IV. The child's physical memory consumption doubles immediately at fork.
- A. I and II only
- B. II, III and IV only
- C. I, III and IV only
- D. I, II and III only
Correct answer: D. I, II and III only
IV is false: only pages that are actually written get copied, so fork followed by exec costs very little memory. I-III describe the standard mechanism.
More Operating Systems questions
- Under first-fit, the fifty-percent rule says that with N allocated blocks there are about N/2 holes. In a measured system the average hole…
- A machine has 48-bit virtual addresses, 16 KB pages and 8-byte page-table entries. Every page-table node must fit in one page, lower…
- Two processes bounce a 1-byte message through a pair of pipes: 100,000 round trips take 1.2 s, and each round trip contains two context…
- MFU replacement with 3 frames (initially empty): the victim is the resident page with the LARGEST reference count since it was loaded…
- FIFO page replacement is run on the string 6, 1, 7, 2, 7, 2, 1, 5, 1, 1, 7, 5, 3, 1, 1, 7, 4, 5, 3, 4 (memory initially empty) with each…
- The clock algorithm uses 3 frames (initially empty); the reference bit is set when a page is loaded and on every hit. On a fault the hand…