- Mastering Linux Kernel Development
- Raghu Bharadwaj
- 267字
- 2021-07-08 09:47:13
state
A process right from the time it is spawned until it exits may exist in various states, referred to as process states--they define the process’s current state:
- TASK_RUNNING (0): The task is either executing or contending for CPU in the scheduler run-queue.
- TASK_INTERRUPTIBLE (1): The task is in an interruptible wait state; it remains in wait until an awaited condition becomes true, such as the availability of mutual exclusion locks, device ready for I/O, lapse of sleep time, or an exclusive wake-up call. While in this wait state, any signals generated for the process are delivered, causing it to wake up before the wait condition is met.
- TASK_KILLABLE: This is similar to TASK_INTERRUPTIBLE, with the exception that interruptions can only occur on fatal signals, which makes it a better alternative to TASK_INTERRUPTIBLE.
- TASK_UNINTERRUTPIBLE (2): The task is in uninterruptible wait state similar to TASK_INTERRUPTIBLE, except that generated signals to the sleeping process do not cause wake-up. When the event occurs for which it is waiting, the process transitions to TASK_RUNNING. This process state is rarely used.
- TASK_ STOPPED (4): The task has received a STOP signal. It will be back to running on receiving the continue signal (SIGCONT).
- TASK_TRACED (8): A process is said to be in traced state when it is being combed, probably by a debugger.
- EXIT_ZOMBIE (32): The process is terminated, but its resources are not yet reclaimed.
- EXIT_DEAD (16): The child is terminated and all the resources held by it freed, after the parent collects the exit status of the child using wait.
The following figure depicts process states:

推薦閱讀
- INSTANT OpenCV Starter
- 造個(gè)小程序:與微信一起干件正經(jīng)事兒
- PostgreSQL Cookbook
- Python高效開(kāi)發(fā)實(shí)戰(zhàn):Django、Tornado、Flask、Twisted(第2版)
- Java EE 7 Development with NetBeans 8
- 手把手教你學(xué)C語(yǔ)言
- EPLAN實(shí)戰(zhàn)設(shè)計(jì)
- Python算法從菜鳥(niǎo)到達(dá)人
- 組態(tài)軟件技術(shù)與應(yīng)用
- 青少年信息學(xué)競(jìng)賽
- Learning Apache Cassandra
- C語(yǔ)言從入門(mén)到精通
- Regression Analysis with Python
- Orchestrating Docker
- ABAQUS6.14中文版有限元分析與實(shí)例詳解