Process control block
|
A Process Control Block (PCB) is a data structure in the operating system kernel representing the state of a given process.
Implementations differ, but in general a PCB will contain:
- The ID of the process (PID)
- Register values for the process
- The Program Counter for the process
- The Memory Management Unit (MMU) for the process
- A list of open files & sockets
- Process accounting information, such as when the process was last run, how much CPU time it has accumulated, etcetera.
During a context switch, the running process is stopped and another process gets a chance to run. The kernel must stop the execution of the running process, copy out the values in hardware registers to its PCB, and update the hardware registers with the values of the new process.