Topics: Red Hat / Linux, System Admin
Processes
A process is a running instance of a launched, executable program. A process consists of:
- an address space of allocated memory,
- security properties including ownership credentials and privileges,
- one or more execution threads of program code, and
- the process state.
- local and global variables,
- a current scheduling context, and
- allocated system resources, such as file descriptors and network ports.
Through the fork routine, a child process inherits security identities, previous and current file descriptors, port and resource privileges, environment variables, and program code. A child process may then exec its own program code. Normally, a parent process sleeps while the child process runs, setting a request (wait) to be signaled when the child completes. Upon exit, the child process has already closed or discarded its resources and environment; the remainder is referred to as a zombie. The parent, signaled awake when the child exited, cleans the remaining structure, then continues with its own program code execution.
In a multitasking operating system, each CPU (or CPU core) can be working on one process at a single point in time. As a process runs, its immediate requirements for CPU time and resource allocation change. Processes are assigned a state, which changes as circumstances require.
The Linux process states are illustrated in the previous diagram and described in the following table.
| Name | Flag | Kernel-defined state name and description |
|---|---|---|
| Running |
R
|
TASK_RUNNING: The process is either executing on a CPU or waiting to run. Process can be executing user routines or kernel routines (system calls), or be queued and ready when in the Running (or Runnable) state. |
| Sleeping |
S
|
TASK_INTERRUPTIBLE: The process is waiting for some condition: a hardware request, system resource access, or signal. When an event or signal satisfies the condition, the process returns to Running. |
D
|
TASK_UNINTERRUPTIBLE: This process is also Sleeping, but
unlike |
|
K
|
TASK_KILLABLE: Identical to the uninterruptible |
|
| Stopped |
T
|
TASK_STOPPED: The process has been Stopped (suspended), usually by being signaled by a user or another process. The process can be continued (resumed) by another signal to return to Running. |
T
|
TASK_TRACED: A process that is being debugged is also temporarily
Stopped
and shares the same |
|
| Zombie |
Z
|
EXIT_ZOMBIE: A child process signals its parent as it exits. All resources except for the process identity (PID) are released. |
X
|
EXIT_DEAD: When the parent cleans up (reaps) the remaining child process structure, the process is now released completely. This state will never be observed in process-listing utilities. |
If you found this useful, here's more on the same topic(s) in our blog:
- How to run background jobs
- Truss
- Creating graphs from NMON
- Howto setup AIX 'boot debugger'
- Automatically e-mail error report entries
Interested in learning more?




