PROCESS STATE
PROCESS STATE
The state of a process is defined in part by the current activity of that process.
As a process executes, it changes state.
A process may be in one of the following states:
1. New. The process is being created.
2. Running. Instructions are being executed.
3. Waiting. The process is waiting for some event to occur (such as an I/O completion or reception of a signal).
4. Ready. The process is waiting to be assigned to a processor.
5. Terminated. The process has finished execution.
The states that they represent are found on all systems.
It is important to realize that only one process can be running on any processor at any instant. Many processes may be ready and waiting, however.
The state diagram corresponding to these states is presented below.
Diagram of process states
SCHEDULING QUEUES
Job queues
As processes enter the system, they are put into a job queue, which consists of all processes in the system.
Ready queues
· The processes that are residing in main memory and are ready and waiting to execute are kept on a list called the ready queue.
· This queue is generally stored as a linked list.
· A ready-queue header contains pointers to the first and final PCBs in the list. Each PCB includes a pointer field that points to the next PCB in the ready queue.
Device queue
· Suppose the process makes an I/O request to a shared device, such as a disk. Since there are many processes in the system, the disk may be busy with the I/O request of some other process. The process therefore may have to wait for the disk.
· The list of processes waiting for a particular I/O device is called a device queue.
· Each device has its own device queue
The ready queue and various I/O device queues
Queuing diagram of process scheduling
A common representation of process scheduling is a queueing diagram.
Each rectangular box represents a queue. Two types of queues are present: the ready queue and a set of device queues. The circles represent the resources that serve the queues, and the arrows indicate the flow of processes in the system.
Comments
Post a Comment