What is a Process Control Block (PCB), and what specific information does the OS store in it to manage a process?
Last updated
A Process Control Block (PCB) is the kernel data structure that represents a process: it holds everything the OS needs to suspend, resume, and manage that process. On a context switch, the OS saves the running process's state into its PCB and loads the next one's.
Identification: Process ID (PID), parent PID, and owner/user info.
CPU state (for resuming):
Program counter and register contents saved at the last switch.
Current process state (Ready, Running, Waiting, etc.).
Scheduling info: Priority, scheduling queue pointers, and accounting stats (CPU time used).
Memory management: Page tables, base/limit registers, or segment information for the address space.
I/O and resources: Open file descriptors, allocated devices, and signal handlers.
Why it matters: The PCB is what makes a process resumable: saving/restoring it is the essence of a context switch.
- https://www.youtube.com/watch?v=0UBKW3ieQes
- https://www.tutorialspoint.com/article/what-is-a-process-control-block
- https://medium.com/@mshimaiem01/understanding-the-process-control-block-pcb-83023e36686a
- https://www.scaler.com/topics/operating-system/process-control-block-in-os/
- https://www.geeksforgeeks.org/interview-experiences/oracle-interview-experience-virtual-hiring-2021-batch/
- https://dev.to/kathanvakharia/operating-systems-process-control-blocks-pcb-na9