Processes & the Process Abstraction

the process tree

A family tree has one ancestor at the top, and everyone below traces back to them through a chain of parents and children. The processes on a running system form exactly this kind of tree: one original process at the root, and every other process descending from it because every process (but the first) is created by a parent. The process tree is this hierarchy of all processes, branching out from the first process.

Each process has exactly one parent (the process that created it via fork) and can have any number of children. Drawing parent above child, the result is a tree: at the root is the first process (PID 1, init or systemd); it starts the core services; those start more processes; and so on down to the individual programs you launch. Because each process records its parent, the OS can reconstruct this whole tree, and tools can display it as an indented hierarchy. The tree is dynamic: branches grow as processes fork and prune as processes exit.

The process tree is more than a picture; it underlies real behavior. Cleanup follows the tree: a parent reaps its children, and when a parent dies, its orphaned children are re-parented to init so they are not lost. Some signals and resource limits propagate along the tree to whole subtrees of related processes. And it explains why killing a parent does not by itself kill the children, they keep running, just re-parented, unless the system is explicitly told to terminate the whole group.

init (PID 1) starts a login service, which starts your shell, which starts an editor and a compiler. Drawn as a tree, init is the root and the editor and compiler are leaves several levels down.

Every process traces a chain of parents back to PID 1 at the root.

Killing a parent does not automatically kill its children. The children keep running and are re-parented (to init), unless you explicitly signal the whole process group.

Also called
process hierarchyprocess family tree行程樹行程階層