Suppose a process ie parent forks a child process using reso

Suppose a process (i.e., parent) forks a child process using resource sharing such that the parent and child share all resources. Does this include the Process Control Block and memory space or does the child get its own copy? Explain your answer (why the child would or would not get its own PCB and memory space).  

Solution

When a process forks a child process, it creates a copy of itself. This operation in linux kernel, creates a separate address space for the child. With this, the child process will also get an exact copy of all the memory segments of the process which fork(ed) it i.e. the parent process. This also includes PCB(process control block) of the parent process, which is duplicated for the child process. Program counters, registers etc which are used in the execution of the child process are also duplicated from the parent.

Suppose a process (i.e., parent) forks a child process using resource sharing such that the parent and child share all resources. Does this include the Process

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site