Skip to content

10. PCB — Process Control Block

The OS's complete "file" on a process — everything needed to manage, pause, resume, and terminate it. Lives in kernel space; user programs can't access it directly.

Contents:

  1. Identification: PID, PPID, UID/GID
  2. State: RUNNING, READY, BLOCKED, etc.
  3. CPU context: PC, registers, flags (saved/restored on context switch)
  4. Memory info: page table pointer, base/limit registers, segment boundaries
  5. Scheduling info: priority, CPU time used, start time
  6. I/O status: open file table, pending I/O, allocated devices
  7. Accounting: page faults, context switch counts
Field PCB (Process) TCB (Thread)
IDPIDTID
RegistersYesYes
PCYesYes
Stack pointerYesYes
Page tableYesNo (shares process's)
File descriptorsYesNo (shares process's)

A TCB is smaller and cheaper — that's why thread switches are faster.

Seeing PCBs on Linux: ps aux, cat /proc/<pid>/status, ls /proc/<pid>/fd, cat /proc/<pid>/maps.