Linux Process State

TASK_RUNNING: The process is runnalbe, it is either currently running or on a runqueue waiting to run. This is the only possible state for a process executing in user-space, it can also apply to a process in kernel-space that is actively running.

TASK_INTERRUPTIBLE: The process is sleeping(it is blocked), waiting for some condition to exist. When this condition exist, the kernel sets the process's sate to TASK_RUNNING. The process also awakes prematurely and becomes runnable if it receives a signal.

TASK_UNINTERRUPTIBLE: Identical to TASK_INTERRUPTIBLE except that process in this state can't be wake up and become runnable by receiving a signal. This is used in situations where the process must wait without interruption or when the event is expected to occur quite quickly. Because the task in this state does not response to signals, this is why we have those dreaded unkilled processes with state D in ps command's result, because the task will not respond to signal, you can't send it a SIGKILL signal. TASK_UNINTERRUPTIBLE is less often used than TASK_INTERRUPTIBLE.

TASK_ZOMBIE: The task has terminated, but its parent has not yet issued a wait4() system call. The task's process descriptor must remain in case the parent wants to access it. If the parent calls wait4(), the process descriptor is deallocated.

TASK_STOPPED: Process execution has stopped, the task is not running nor is it eligible to run. This occurs if the task receives the SIGSTOP, SIGTSTP, SIGTTIN or SIGTTOU signal or if it receives any signal while it is being debugged.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章