- Multi-programming environment provides maximum CPU utilization by executing multiple processes simultaneously.
- When process enters in the system, they are put into a job queue.
- The queue consists of all processes in the system.
- The processes that are stored in main memory and ready to execute are kept on a list called ready queue.
- This queue is generally stored as a link list.
- A ready queue header contains pointers to the first and the last PCB in the list.
- Each PCB includes a pointer field that points to the next PCB in the ready queue.
- When a process is allocated the CPU, it executes for sometime until interrupt or I/O request is generated.
- In case of an input/output request, some request may be for tape drive or shared device such as disk.
- Since system has many processes, the disk may be busy with some other processes for input/output operation.
- The list of processes waiting for a particular input/output device is called a device queue.
- Each device has its own queue that contains all processes which are waiting for that device.
- Enqueue process is initially put in ready queue. It waits in ready queue until it is selected for execution.
- Once the process is assigned to the CPU, then it executes.
- During execution of the process one of several events occurs in the process and issue an input/output request and then places in an input output queue.
- The process could create a new sub-process and waits for termination.
- A process can be removed from the CPU as a result of interrupt and put back in ready queue.
- A process continues this cycle until it terminates and it is removed from all queues and all the values that are stored in PCB are cleared.
- Memory and other resources are also deallocated.