Appearance
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:
- Identification: PID, PPID, UID/GID
- State: RUNNING, READY, BLOCKED, etc.
- CPU context: PC, registers, flags (saved/restored on context switch)
- Memory info: page table pointer, base/limit registers, segment boundaries
- Scheduling info: priority, CPU time used, start time
- I/O status: open file table, pending I/O, allocated devices
- Accounting: page faults, context switch counts
| Field PCB (Process) TCB (Thread) | ||
|---|---|---|
| ID | PID | TID |
| Registers | Yes | Yes |
| PC | Yes | Yes |
| Stack pointer | Yes | Yes |
| Page table | Yes | No (shares process's) |
| File descriptors | Yes | No (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.