what is process and state of process & pcb(process control block)

  

Process - A process is an ‘active’ entity as opposed to a program which is considered to be a ‘passive’ entity. A single program can create many processes when run multiple times, for example when we open a .exe or binary file multiple times, many instances begin (many processes are created).
 


1)        Process stateProcesses may be in one of 5 states, as shown in Figure below –

            

·         NEW- The process is being created.
·         READY- The process is waiting to be assigned to a processor.
·         RUNNING- Instructions are being executed.
·         WAITING- The process is waiting for some event to occur (such as an I/O completion or reception of a signal).
·         TERMINATED- The process has finished execution.
3).   PCB (process control block) –
·        Each process is represented in the operating system by a process control block (PCB).
·        It is also called task control block.
·        Process State - Running, waiting, etc., as discussed above.
·        Process ID and parent process ID.
·        CPU registers and Program Counter- These need to be saved and restored when swapping processes in and out of the CPU.
·        CPU-Scheduling information - Such as priority information and pointers to scheduling queues.
·        Memory-Management information- E.g. page tables or segment tables.
·        Accounting information - user and kernel CPU time consumed, account numbers, limits, etc.
·        I/O Status information - Devices allocated, open file tables, etc.

                             
                     Process control block (PCB)