CS FundamentalsHardGATE CS (PYQ pattern)

A parent has 1000 pages mapped copy-on-write after fork, all initially shared. The child then writes to 100 distinct pages, and afterwards the parent writes to 50 pages, of which 20 are among the pages the child already wrote. Assuming a copy is made only when a write finds a page shared by more than one process, how many physical frames hold the data in total?

  1. A. 1130
  2. B. 1100
  3. C. 1150
  4. D. 1170

Correct answer: A. 1130

The child's 100 writes create 100 new frames. The parent's 20 writes to pages already copied by the child find a reference count of 1 and need no copy; its other 30 writes need copies. Total = 1000 + 100 + 30 = 1130.

More Operating Systems questions

Exams that ask this topic