we have already read the concept of process ,not let us see what it is process states, please check the below figure
States of Process:
Start : The process has just arrived.
Ready : The process is waiting to grab the processor.
Running : The process has been allocated by the processor.
Waiting : The process is doing I/O work or blocked.
Halted : The process has finished and is about to leave the system.
In the OS, each process is represented by its PCB (Process Control Block).
The PCB,generally contains the following information:
- Process State,
- Process ID,
- Program Counter (PC) value,
- Register values
- Memory Management Information (page tables, base/bound registers etc.)
- Processor Scheduling Information ( priority, last processor burst time etc.)
- I/O Status Info (outstanding I/O requests, I/O devices held, etc.)
- List of Open Files
- Accounting Info.
If we have a single processor in our system, there is only one running process at a time. Other ready processes wait for the processor. The system keeps these ready processes (their PCBs) on a list called Ready Queue which is generally implemented as a linked-list structure.
When a process is allocated by the processor, it executes and after some time it either finishes or passes to waiting state (for I/O). The list of processes waiting for a particular I/O device is called a Device Queue. Each device has its own device queue.
In multi-programming systems, the processor can be switched from one process to another. Note that when an interrupt occurs, PC and register contents for the running process (which is being interrupted) must be saved so that the process can be continued correctly afterwards.Switching between processes occurs as depicted below.