Describe the relationship between a parent and child process in Linux when they share memory from the heap
In Unix, Fork system call is the only way for user to create a new process.
PID = fork();
It creates two process having identical copies of their user level context except returned PID. Kernel allocates child process as a PID=0.
As part of the Fork process, Kernel allocates memory for the child process u area, regions, and auxiliary page tables, duplicates every region in the parent process and attaches every region to the child process. When the child context is ready, the parent completes its part of fork by changing the child state to “ready to run Gn memory” and by returning the child process ID to the user.
Get Answers For Free
Most questions answered within 1 hours.