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?
- A. 18
- B. 15
- C. 13
- 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
- Three periodic tasks with deadline = period have (C, T) = (1, 4), (2, 6) and (3, 12), scheduled by rate-monotonic priority. Which…
- A low-priority task L holds a mutex needed by high-priority task H. A medium-priority task M, which does not need the mutex, becomes ready…
- In a monitor with Mesa (signal-and-continue) semantics, why must a consumer check its condition with while (count == 0) wait(notEmpty)…
- Five dining philosophers each pick up the left fork and then the right fork. Which change removes the possibility of deadlock without a…
- A user creates file f, makes a hard link h to it and a symbolic link s to f. Then f is deleted and a NEW file named f is created with…
- In the standard five-state process model (new, ready, running, blocked, exit), which transition can NOT happen directly?