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
- 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).
- Describe how exactly the Copy-on-Write technique would be implemented.
- 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
#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
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
Get step-by-step solutions from verified subject matter experts
