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.
本文详细解释了操作系统中进程的各种状态,包括运行中(TASK_RUNNING)、可中断睡眠(TASK_INTERRUPTIBLE)、不可中断睡眠(TASK_UNINTERRUPTIBLE)、僵尸状态(TASK_ZOMBIE)及停止状态(TASK_STOPPED)。这些状态反映了进程在不同条件下的行为特征。
1309

被折叠的 条评论
为什么被折叠?



