0% found this document useful (0 votes)
82 views1 page

1) Spawned Process Is Destroyed When Parent Is Destroyed. Advantage

1) When a parent process spawns a child process, there are two possibilities for how their address spaces relate. If they share the same program and data, deleting the parent would also delete the child. However, if the child loads a new program, deleting the parent early could interrupt the child's independent processing. 2) If the child process proceeds independently after spawning, deleting the parent has less risk of interfering. The child would treat the init process as its new parent. However, if the parent waits for the child before exiting, it uses memory the whole time, which could be allocated to other processes sooner.

Uploaded by

Jaswinder Thakur
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views1 page

1) Spawned Process Is Destroyed When Parent Is Destroyed. Advantage

1) When a parent process spawns a child process, there are two possibilities for how their address spaces relate. If they share the same program and data, deleting the parent would also delete the child. However, if the child loads a new program, deleting the parent early could interrupt the child's independent processing. 2) If the child process proceeds independently after spawning, deleting the parent has less risk of interfering. The child would treat the init process as its new parent. However, if the parent waits for the child before exiting, it uses memory the whole time, which could be allocated to other processes sooner.

Uploaded by

Jaswinder Thakur
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

1)Spawned process is destroyed when parent is destroyed . Advantage: There can be two possibilities in term of address space.

The child process has same program and data as parent means it is duplicate of the parent or the child process has new program loaded in it. Also lets consider both process parent and child are executed concurrently. Now lets take an example in which an new process is created using Fork() system call with above mentioned parameter. Since both parent and child has same data and program that means they are two different level process belonging to same program. When the execution of iven program is completed, it is beneficial to delete it for the memory management. In this case parent process invoke an exit() system calls to OS and terminate the process. Disadvantage: In case when a different program is loaded in the child process as compared to parent, then deletion of parent node can be fatal to child node. This is because lets consider that parent has finished its processing and no longer beneficial to keep it loaded in main memory and it is terminated to delete it. While a different processing is still going on child node. Deletion of parent node in this case would not be good. 2)Child process proceed independently and parent process destroyed Advantage: Basically in this case child node start considering the second process to parent process as their new parent process and collect their status and execution statistics. Process running in child if they have diffenret data than parent will not get affected if parent process is deleted. Disadvantage: In some system parent process is not deleted and wait for the child process to finish its execution. In that case, parent process is occupying valuable main memory space which can be used by other processes. So, sometimes it is beneficial to delete the parent processes.

You might also like