Free — no signup required

Process States: Running and Sleeping

2 min read

The Waiting Game

Processes are not always actively burning CPU cycles. In fact, most processes spend the vast majority of their time waiting — for a keypress, a network packet, a disk read to complete, or a timer to fire. Linux tracks each process's current activity with a state, visible in the STAT column of ps or the S column of top.

Running or Runnable (R)

The process is either currently executing on a CPU core right now, or it is fully ready to run and waiting in the scheduler's run queue for its turn. On a 4-core machine, up to 4 processes can be in the truly-executing sub-state simultaneously.

Interruptible Sleep (S)

The process is waiting for an event — keyboard input, a network response, a sleep() timer, a mutex to be released. It is consuming zero CPU. It is "interruptible" because a signal (like SIGTERM or SIGINT from Ctrl+C) can wake it up immediately, even before the event it was waiting for arrives. This is the most common state for background daemons and idle processes.

Stopped (T)

The process has been explicitly paused, either by receiving SIGSTOP or by a debugger attaching to it (via ptrace). It will not run again until it receives SIGCONT. This is what happens when you press Ctrl+Z in a shell — the foreground job is sent SIGTSTP and moves to this state.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free