What is Process Scheduling?


Process scheduling is the activity of the process manager that manages the elimination of the running procedure from the CPU and the selection of another procedure based on a particular approach. The objective of the process scheduling system is to maintain the CPU busy all the time and to produce minimum response time for all programs. For reaching this, the scheduler should use specific rules for swapping processes IN and OUT of the CPU.

Process scheduling involves three key concepts such as the declaration of distinct process states, the specification of the state transition diagram, and the statement of a scheduling policy.

Process States − There are three basic states connected with scheduling as the ready-to-run state, the running state, and the wait (or blocked) state. In the ready-to-run state, processes can run when a processor is allocated for them. In this state, they are waiting for the processor to be designated. In the running state, they are in the execution of the allocated processor. In the wait state, they are suspended or blocked waiting for the appearance of several events before obtaining ready-to-run again.

State transition diagram − It is based on these states, the possible state transitions, and their conditions are stated, usually in a state transition diagram. For the straightforward case represented by the basic states, the state transition diagram of the scheduler can be specified as shown in the figure.

When the scheduling selects a process for execution, its state is modified from ready-to-run. The process remains in this state until one of the following three events occurs −

  • In compliance with the scheduling policy, the scheduler decides to cease execution of the process and puts it into the ready-to-run queue again, changing its state accordingly.

  • The process in execution issues an instruction that causes this process to wait until an event takes place. In this case, the process state is changed to the wait state and its PCB is placed in the queue of waiting (or blocked) processes.

  • If the process arrives at the end of the execution, it terminates.

Scheduling Policy − The last scheduling component specifies rules for managing multiple competing processes, this is usually termed the scheduling policy. When the processor completes execution it is terminated, launching all the allocated resources. Many operating systems are based on the process model such as the IBM/360/DOS, OS/MFT, OS/MVT, UNIX, VMS, etc.

Updated on: 27-Jul-2021

668 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements