Process state is the current stage of a process in its lifecycle, recorded by the kernel to show whether the program is executing on a CPU, waiting for a CPU or waiting for an event such as disk input. In operating systems, the state drives nearly every decision of the scheduler, because only processes in the right state can be chosen to run.
The sequence of states a program passes through from creation to removal is often called the process lifecycle. Every topic in processes & scheduling, from time slices to priority inversion, ultimately describes how and why processes move between these states.
How the kernel tracks process state
The kernel stores the state as a field inside the process control block, the per-process data structure that also holds registers, memory maps and open files. A state transition is simply an update of that field combined with moving the process between kernel queues, so the state and the queue membership always agree.
Ready processes sit in the run queue, while blocked processes sit in wait queues attached to the resource they need, such as a pipe, a lock or a disk request. When the resource becomes available, the kernel performs a wakeup, changes the state to ready and inserts the process into the run queue again.
On a machine with several cores, one running process per core is the upper limit at any instant. All other runnable processes wait in the ready state, which is why a system can show hundreds of processes while only a handful actually execute.
The classic five-state model
Textbooks describe process state with a five-state model that captures the essential behavior of every general-purpose kernel. The table lists each state, what the process is doing and where the kernel keeps it.
| State | Meaning | Where the kernel keeps it |
|---|---|---|
| New | Being created, resources still allocated | Process table, not yet schedulable |
| Ready | Able to run, waiting for a CPU | Run queue |
| Running | Executing instructions on a core | Current task of that core |
| Blocked | Waiting for I/O or another event | Wait queue of the resource |
| Terminated | Finished, awaiting final cleanup | Process table until reaped |
Some models add suspended ready and suspended blocked states for processes whose memory was swapped out entirely. Modern paging systems rarely swap whole processes, so these extra states now appear mostly in theory and in older designs.
Transitions between process states
A process changes state only through well-defined events, and each event is handled by a specific part of the kernel. Knowing the trigger of each transition explains most scheduling behavior.
| Transition | Typical trigger | Kernel component involved |
|---|---|---|
| New to ready | Creation completes after fork or spawn | Process creation code |
| Ready to running | Scheduler dispatches the process | Scheduler and dispatcher |
| Running to ready | Time slice expires or preemption | Timer interrupt handler |
| Running to blocked | System call that must wait | System call layer |
| Blocked to ready | I/O completion or signal | Interrupt or wakeup path |
| Running to terminated | Exit call or fatal signal | Exit and cleanup code |
A blocked process never moves directly to running. It must first become ready and then win the scheduler decision, which is why a process that just received its data may still wait a few milliseconds before it continues. In preemptive multitasking, the running-to-ready transition can happen at any instruction; in cooperative multitasking, it happens only when the process yields voluntarily.
Process states in real kernels
Production kernels refine the textbook model with more specific states that reveal why a process is waiting. Tools such as ps and top on Linux show these states as single-letter codes, and Windows exposes similar thread states through its performance tools.
| Code | Linux state | Textbook equivalent |
|---|---|---|
| R | Running or runnable | Running or ready |
| S | Interruptible sleep | Blocked, wakes on signal |
| D | Uninterruptible sleep | Blocked, ignores signals |
| T | Stopped by job control or debugger | Suspended |
| Z | Zombie, exited but not reaped | Terminated |
Linux deliberately merges ready and running into one runnable state, because the difference changes every few milliseconds. Windows tracks state per thread rather than per process, with states such as Ready, Running, Waiting and Standby, which reflects the fact that the thread is the real unit of scheduling there.
Zombie and orphan processes
A zombie process has finished execution but keeps its process table entry until the parent process reads its exit status with a wait call. Zombies use almost no memory, but each one holds a process identifier, and a parent that never reaps its children can exhaust the PID space.
An orphan process is a child whose parent exited first. Unix-like systems reassign orphans to init or a designated subreaper, which reaps them automatically, so orphans are normal while accumulating zombies indicate a bug in the parent program.
Diagnosing problems with process state
Reading process states is one of the fastest diagnostic techniques for a slow or hung system. The distribution of states shows whether the bottleneck is the CPU, storage or application logic.
| Observed pattern | Likely cause | Recommended check |
|---|---|---|
| Many processes in R | CPU saturation | Compare load average with core count |
| Many processes in D | Slow storage or stuck network file system | Inspect I/O wait and device latency |
| Growing number of Z | Parent does not call wait | Fix child reaping in the parent |
| Process stuck in S | Waiting on lock, socket or pipe | Trace system calls and lock holders |
A common misconception treats a high load average as pure CPU load. On Linux, the load average counts both runnable and uninterruptible processes, so a storage stall can raise it sharply while the CPU remains mostly idle. Another frequent mistake is trying to kill a process in state D: the signal is queued but takes effect only after the I/O completes.
Put simply
Think of a busy doctor’s office with a single doctor. One patient is inside the examination room, several patients sit in the waiting room, and a few others have gone to get a blood test and cannot see the doctor until the results come back.
A computer treats its programs the same way. The process state is simply a label saying which group each program belongs to right now: working on the processor, waiting its turn or waiting for something else to finish. The system uses these labels to decide who goes next, so the state is how the computer keeps order among many programs.
In practice
An administrator of a Linux build server notices that compilation jobs take twice as long as usual. The machine has 16 cores, and the load average shows about 40, which at first suggests the CPU is overloaded. Running top reveals a different picture: CPU usage sits near 30 percent, and roughly 25 compiler processes show state D.
The uninterruptible sleep points to storage, not computation. Further checks show that the shared network file system holding the source tree responds with latencies above 200 milliseconds after a switch failure. Once the network path is repaired, the D-state processes return to R, the load average falls below 16 and build times return to normal without adding any CPU capacity.