CREATE OWN LIBRARY

Process Control Block (PCB or Task Control Block)

 

Whenever a process is newly born, OS allocated an id (Process Id) on it. Actually, to implement the process model, the operating system maintains a table (an array of structures), called the process table, with one entry per process. These entries are called Process Control Block.                   

 

Attributes of a Process:

1.  Process Id:  A unit number for a Process.

 

2. Program Counter: The counter indicates the address of the next instruction to be executed for this process.

 

3.  Process States: When the process is running, it will occur in different states. The state may be new, ready, running, waiting, halted, and so on.

 

4. Process Privileges: In terms of allowed/disallowed access to system resources.

 

5. Registers: The registers vary in number and type, depending on the computer architecture. They include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. Along with the program counter, this state information must be saved when an interrupt occurs, to allow the process to be continued correctly afterward.

 

6. List of open files: When the process is running some files are needed to Read or Write and after Completion it should closed.

 

7.  List of open devices: Open devices like printers, scanners, etc.

 

8. Inter process communication information: Various messages, signals, and flags associated with the communication between independent processes may be stored in the PCB.

 

9.  Memory-management information: This information may include such items as the value of the base and limit registers and the page tables, or the segment tables, depending on the memory system used by the operating system.

 

10.  Priority: Priority level relative to other processes.

 

11. Accounting Information: This information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.

 

13. I/O Status Information: Includes outstanding I/O devices, I/O requests assigned to this process, a list of files in use by the process.

 

Fig 9: Diagram showing CPU switch from process to process

 

 

Important note:  All PCBs of every Process are connected by a linked list.