CS FundamentalsModerateIBM · Deloitte pattern
Modern fork() implementations use copy-on-write. Which statement is correct?
- A. Only the stack is copied; heap and data remain shared
- B. Pages are shared read-only after fork, and a page is duplicated only when either process writes to it
- C. The entire address space is copied immediately, but lazily mapped
- D. Parent and child share all pages forever, so a write by one is seen by the other
Correct answer: B. Pages are shared read-only after fork, and a page is duplicated only when either process writes to it
After fork, both page tables point to the same frames marked read-only. The first write causes a protection fault, and the kernel then copies just that page. Semantics stay as if the whole space were copied.
More Operating Systems questions
- Segment table (base, limit): S0 (1400, 600), S1 (6300, 400), S2 (4300, 300), S3 (3200, 1100). What happens for logical addresses (2, 120)…
- Page size is 1 KB. The page table maps page 0 → frame 3, page 1 → frame 7, page 2 → frame 5, page 3 → frame 2. What physical address…
- Which statement about threads of the same process is FALSE?
- Processes: A (arrival 0, burst 5), B (arrival 1, burst 3), C (arrival 2, burst 8), D (arrival 3, burst 6). Round Robin, quantum 4. A…
- Processes: P1 (arrival 0, burst 7), P2 (arrival 2, burst 4), P3 (arrival 4, burst 1), P4 (arrival 5, burst 4) (ms). Round Robin with…
- Processes: A (arrival 0, burst 5), B (arrival 1, burst 3), C (arrival 2, burst 8), D (arrival 3, burst 6). Priorities A = 3, B = 1, C = 4…