Question: Consider the below program that shows a parent process using fork() to create a child process. Assume it runs on a Unix system that uses

  1. Consider the below program that shows a parent process using fork() to create a child process. Assume it runs on a Unix system that uses the Copy-on-Write technique and some form of simple paging (The details of how paging is implemented are not important).
  2. Describe how exactly the Copy-on-Write technique would be implemented.
  3. Give an estimate for how many operations (i.e., trap into kernel, allocate a new frame for the child, copy the contents over, map the child to the new frame) will be required for this program? Describe in details
  4. #include < #include < int global; H void main() { < int i, pid; int local; < pid= fork(); < if(pid > 0) < 

#include < #include < int global; H void main() { < int i, pid; int local; < pid= fork(); < if(pid > 0) < global = 1;4 local = 2;4 }else global = 5; local = 6;4

Step by Step Solution

3.41 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

CopyonWrite is implemented in the example program When the parent process forksthe operating system creates a new page table for the child processThe childs page table is initially identical to the pa... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!