Introduction

  • It is also called Process Table/Task Control Block/Switch Frame.

Definition

  • Process control block(PCB) is a data structure (actually in the form of array of structure) which contains several necessary information regarding the executing processes in tabular form.

Features

  • It is maintained by an OS automatically during program execution.
  • A PCB must stores everything about the process and is also saved when the process is switched from one state to other i.e. the running state to the ready state so that it can be restarted later/again.
  • It is very important for process management as it contains the detail of a process.
  • It also defines the current state of the operating system.

Structure

  • A PCB contains following information about a process-
    • Process state:-
      • It represents that a process is either in a new, ready, running, waiting or halted state currently .
    • Process number/ID:-
      • It is a unique number or id given to each process during its birth to identify/call it easily during processing.
    • Program counter:-
      • It stores the address of the next instruction that needs to be executed in the process.
    • CPU registers:-
      • The different types of cpu registers are used to store different types of processing information such as data, instruction, address etc.
      • These registers vary in number and type, depending on the microprocessor architecture. 
      • They may include accumulators, index registers, stack pointers, general purpose registers etc.
    • Memory Management Information:-
      • It includes base and bound/limit registers or page table or segment table to manage the memory as per need.
    • I/O Status Information:-
      • This information contains several I/O requests, I/O devices used by the process, list of related I/O files and so on.
    • CPU/Processor Scheduling Information:-
      • This information includes process priority, pointers to scheduling queues and any other scheduling parameters. 
    • List of Open Files:-
      • These are different type of files that are directly or indirectly associated with the process.

    • Accounting information:-

      • This information contains the statistics detail of PCB i.e. the time limits, account numbers, amount of CPU used, process numbers etc.

    • Location of the PCB:-

      • The process control block is created and kept in a memory area which is protected from the normal user access, because it contains several important & sensitive process information. In Some operating systems it is placed at the beginning of the kernel stack as it is a safe location.

Use

  • PCB is used to implement process model to the running task/process.
  • PCB contains information about a process(such as process state, its program counter value, stack pointer value, memory allocation status, the status of its open files, its accounting and scheduling information.) which are very much helpful to identify a process uniquely.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.