Operating System Process Termination |
Operating System Process Termination Exit(), Abort() | Zombie and Orphan process in Operating System
In the last lecture we discussed about the process creation and Child process in details.In this lecture we gona cover the following topics.
1. What is process termination?
2. How a child process terminates
3. What is the Orphan Process
4. What is the concept of Zombie process.
1. Process Termination:When a process startes working it have to get terminated after finishing its task this is the normal way of termination but sometime a process get hangs or a process start troubling you so you also kill the process to keep your experience smoth this is also process termination.On the termination a process gives the Exit() call to the OS so the operating system can know the process has been terminated.
2.Child process termination:
Child terminates by finishing its task and it also return the data or say results of the task to the parent process.
Parent process can also send the Abort() call to child to terminate its processing and return the data to parent.
Some time we explaing this parent child behavior with the sentence "Parent reap the child process".
The word reap means getting/Obtaining something good in the result of something you did.
I hope now you can understand what does parent reap the child means.
3. Orphan process & its types:
So child has a parent but sometime the parent get terminated so the child becomes the orphan thats is what the orphan means.A child without his parent is known as the orphan.
Now there are two different situations or say diferent types of Orphans.
Some child becomes the orphan intentionally others becomes unintentionally what does that mean?
3.1:Intentionally Orphan: Parent is busy in doing his task and child as well but the parent manages to complete his task early and want to terminates.
Normally when a parent terminates its child also terminates as well.
Here the parent has completed its task and want to terminate but the child still have a lot of work to do so the child will ask the parent dad you can get terminated I have a alot of work to do it may take some time I will terminate latter. The parent will get terminated and the child will become orphan intentionally.
3.2: Unintentionally Orphan: this is simple a child may not want his parents to get terminated like in above case but someone kills the parent.
Who and why someone kills the parent?
If a parent get hangs or create some other problems and distrub the computer user may be the end user will kill the parent to avoid the troubles in usage and there can be many more problems like this.
4. What is the Zombie process?Zombie seems like the name got inspiration from the famous movie isn't it?
So far by now what we know that a process reap its child. Some time a process forgets to reap its child. After completing the assign task child releases all the resources which it was using but keeps the ID. As every process have a unique ID and when the parent reap its child it also relese the ID which the child was holding so that other new process can use this ID.
This cycle of IDs keep going on. Process releases the ID on termination and new comers gain it.
Coming back to the topic the child do not release the ID but resources now the OS can't kill this process as it don't have any resources according to OS it is already dead. How can an OS kill the already dead process.
But it is dangerous as it is holding the ID and of processes keep holding IDs like this we may get Shortage of IDs for new process so these kind of process which are not holding the resources but ID and we can't kill them because they are already dead are known as Zombies.
No comments:
Post a Comment