Process States
Process States
Process States
Process State
In a multitasking computer system, processes may occupy a variety of states. These distinct states may not actually be recognized as such by the operating system kernel, however they are a useful abstraction for the understanding of processes.
The operating systems principal responsibility is in controlling the execution of processes. This includes determining the interleaving pattern for execution and allocation of resources to processes. One part of designing an OS is to describe the behavior that we would like each process to exhibit.
Exit
Enter
Not-Running
Running
Pause
Ready
Blocked
Enter
Blocked
Ready
Dispatch Time Out Running Exit Terminated I/0 Wait
Zombie Process
When a process finishes execution, it will have an exit status to report to its parent process. Because of this last little bit of information, the process will remain in the operating systems process table as a zombie process, indicating that it is not to be scheduled for further execution, but that it cannot be completely removed (and its process ID cannot be reused) until it has been determined that the exit status is no longer needed. When a child exits, the parent process will receive a SIGCHLD signal to indicate that one of its children has finished executing; the parent process will typically call the wait() system call at this point. That call will provide the parent with the childs exit status, and will cause the child to be reaped, or removed from the process table. How do I see if there are zombie processes on a system? # top OR # ps aux | awk '{ print $8 " " $2 }' | grep -w Z How do I kill zombie process? You cannot kill zombies, as they are already dead. But if you have too many zombies then kill parent process or restart service. You can kill zombie process using PID obtained from any one of the above command. kill -s SIGCHLD <ppid>
Enter
Blocked
Ready
Dispatch Time Out Suspended Ready Running Exit Terminated I/0 Wait