In this topic, you will learn about, Types of Scheduling.
CPU scheduling may take place under the following four circumstances:
- When a process switches from the running state to the waiting state.
- When a process switches from the running state to the running state.
- When a process switches from the waiting state to the ready state.
- When a process terminates.
A new process must be selected for execution. When scheduling takes place only under 1 and 4th, we say the scheduling state is non-primitive. Otherwise, the scheduling state is primitive.
Under non-primitive scheduling, once the CPU is allocated to the process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state. Whereas in primitive scheduling the CPU is can be taken off in between the execution of the process. Therefore, primitive scheduling incurs a cost.