Skip to content
We areTOP 1%

What are the states of a process, and what is a PCB?

EasyConceptProcesses & Threads
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

A process moves through five states: New (being created), Ready (in memory, waiting for the CPU), Running (executing on the CPU), Waiting or Blocked (waiting for I/O or another event) and Terminated (finished). The OS keeps everything it knows about a process in a Process Control Block (PCB).

  • Ready → Running when the scheduler picks the process (dispatch); Running → Ready when its time slice ends or a higher-priority process arrives.
  • Running → Waiting when it requests I/O; Waiting → Ready when the I/O completes. It never goes from Waiting straight to Running, because it must be scheduled again.
  • The PCB holds the process ID (PID), state, saved program counter and registers, scheduling priority, memory information (such as a pointer to its page table) and the list of open files.

Example: a program that reads a file and prints its size moves like this:

New → Ready → Running → (calls read) Waiting → (disk done) Ready → Running → Terminated

While it is Waiting, its PCB keeps the saved registers, so the process later continues exactly where it stopped.

More in Processes & Threads

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account