What is the purpose of a process control block (PCB) in an operating system?
a) It stores the program counter and process state
b) It manages user interactions with the system
c) It handles file input/output operations
d) It manages network connections
Answer:
a) It stores the program counter and process state
Explanation:
The Process Control Block (PCB) is a data structure maintained by the operating system that stores information about a process. This includes the process state, program counter, CPU registers, memory limits, and more.
Each process has its own PCB that helps the OS manage and track process execution. The PCB ensures that the operating system can resume a process correctly after an interrupt or context switch.
The PCB is crucial for context switching, process scheduling, and system resource management, allowing the OS to efficiently manage multiple processes at the same time.