CS FundamentalsVery hardGATE CS · Product-company placement

A process with 100 private writable pages calls fork() and the system uses copy-on-write; a page is copied only if it is still shared when a write happens. The child then writes to 10 pages; afterwards the parent writes to 5 other pages and to 3 of the child's 10 pages. How many page copies are made?

  1. A. 18
  2. B. 15
  3. C. 13
  4. D. 100

Correct answer: B. 15

The child's 10 writes copy 10 pages. The parent's 5 writes to still-shared pages copy 5 more. The 3 pages the child already copied are now referenced only by the parent, so they are just made writable: 15 copies in all.

More Operating Systems questions

Exams that ask this topic