Operating System - What is PCB in Operating Systems
PCB stands for Process Control Block.
It is a data structure maintained by the operating system for every process. The PCB stores all the information needed to manage the process, such as its current state, ID, register values, and more.
It is essential for context switching, allowing the OS to stop one process and resume another without losing progress.
Component | Description |
---|---|
1. Process ID (PID) | Unique identifier for the process. |
2. Process State | Current state of the process (e.g., New, Ready, Running, Waiting, Terminated). |
3. Program Counter | Address of the next instruction to be executed for this process. |
4. CPU Registers | Contents of all process-specific registers (like accumulator, stack pointer). |
5. Memory Management Info | Includes page tables, segment tables, limits, and base registers. |
6. Accounting Information | CPU usage, time limits, job or user IDs, etc. |
7. I/O Status Info | List of I/O devices assigned, open files, and I/O requests. |
8. Scheduling Info | Priority, pointers to scheduling queues, etc. |
9. Parent/Child Info | Relationships between parent and child processes (if needed). |