Process Control Block in Operating System
Each process is represented in the operating system by its Process Control Block (PCB). A Process Control Block (PCB) is a data block, it consists of all information of a specific process. The PCB is a central store of information that allows the operating system to locate all the key information about the process. The operating system uses this information and performs the operations on the process. The operations include suspend a process, resume a process, change the process priority and dispatch a process.
A process creating a new process is named as the parent, while the created process is called the child. The method of creating a new process is said to be “Spawning Process“. A child process could itself spawn a process, resulting in a tree of processes.
Two processes are “Serial” if the execution of one must be completed before the execution of the other can be started. Two processes are said to be “Concurrent” if they aren’t serial and their execution can overlap in time.
Operation on Process:
Systems that manage processes must be able to perform certain operations with the process. The operation on process include :
1. Create a Process
2. Destroy a Process
3. Resume a Process
4. Change the process priority
5. Block of Process
6. Wakeup a Process
7. Dispatch a Process
8. Enable a process to communicate with other processes
The process terminates from the running state and includes so many causes. Generally, the process terminates when execution finished. Some other causes are:
i. Time Slot expired: When the process execution doesn’t complete within the “Time Quantum”. Then the process terminated from the running state. The CPU picks the next job in the ready queue to execute.
ii. Memory boundary violation: If a process needs more memory than the available memory, then the process is terminated from the running state.
iii. I/O failure: A process need an I/O operation at the time of execution, but the I/O device isn’t available at that time. Then the process moved into the waiting state. The operating system doesn’t provide the I/O device, even if the process resides in the waiting state, then the process terminated.
iv. Parent Termination: When the “Parent Process” terminated, the child process also terminated automatically. The parent process has the authority to terminate any of its children.
v. Parent Request: If the parent process request the child process about the termination, then the child process terminated automatically.
vi. Invalid instruction: If a process has illegal instructions and the CPU fails to execute those instructions, then the process terminated.