CS FundamentalsHardGATE CS
Copy-on-write after fork(): the parent has 1000 resident pages. The child immediately calls exec(). Roughly how many page copies does COW save compared with eager copying, and which pages are still copied?
- A. None; COW still copies all pages at fork()
- B. About 1000 copies are saved; only pages written before exec() (e.g. a few stack pages) get copied
- C. About 500; COW copies half the pages
- D. All 1000 pages are copied at exec() instead
Correct answer: B. About 1000 copies are saved; only pages written before exec() (e.g. a few stack pages) get copied
COW shares pages read-only and copies a page only when one side writes it. A child that writes almost nothing before exec() avoids nearly all copying; exec() discards the shared mappings anyway.
More Operating Systems questions
- What is the main advantage of memory-mapped files (mmap) over read()/write() for random access to a large file?
- Which statement about the page-fault rate versus the number of allocated frames is generally correct for a process with locality?
- The working-set model chooses a window Δ. What happens if Δ is too small and if it is too large?
- Page-fault-frequency (PFF) control sets an upper and a lower bound on each process's fault rate. If a process's rate exceeds the upper…
- Which of the following increase TLB reach without enlarging the TLB? 1. Using larger (huge) pages 2. Supporting multiple page sizes 3…
- On a context switch, why can a TLB WITHOUT address-space identifiers (ASIDs) not simply keep its entries?