Process Scheduling in Operating System (OS)

What is Process scheduling in Operating System

The decision to move different parallel processes competing with one another for execution, to different states like Ready to running or running to exit state based on a certain decision strategy.

Handled by – Process Manager

Why CPU Scheduling?

One or more processes may be in the running state at the same time and they all share the CPU time using multiplexing.

Focus for Intelligent Scheduling is to –

  1. Keep CPU busy as much as possible if processes are waiting for execution
  2. Decrease the time of execution of critical processes
  3. Intelligently prioritise processes for execution
  4. Keep the response time minimum.
Process Scheduling Types OS Operating System

Types of Process Scheduling

We divided Process Scheduling into following two 

  • Preemptive Scheduling –The scheduling in which a running process can be interrupted if a high priority process enters the queue and is allocated to the CPU is called preemptive scheduling. In this case, the current process switches from the running queue to ready queue and the high priority process utilizes the CPU cycle.
  • Non Preemptive Scheduling – The scheduling in which a running process cannot be interrupted by any other process is called non-preemptive scheduling. Any other process which enters the queue has to wait until the current process finishes its CPU cycle

Meaning of Prempt – take action in order to prevent (an anticipated event) happening; forestall.

Process Scheduling Queues

There are the following types of queues –

  1. Job Queue – Whenever any process enters the system its there in job Queue
  2. Ready Queue – Processes in the ready queue waiting for run time are in the ready queue.
  3. Device Queue – Some processes may be waiting some I/O operation, such processes are in the device queue.
Process Scheduling Queues in Operating System

Different Types of Schedulers

There are three type of schedulers categorically –

  1. Long-term Scheduler
  2. Short-term Scheduler
  3. Medium-term Scheduler

Long Term Scheduler

Also knowns as Job Scheduler. It selects the process that are to be placed in ready queue. The long term scheduler basically decides the priority in which processes must be placed in main memory. Processes of long term scheduler are placed in the ready state because in this state the process is ready to execute waiting for calls of execution from CPU which takes time that’s why this is known as long term scheduler.

Medium-Term Scheduler

Also knowns as CPU Scheduler. It places the blocked and suspended processes in the secondary memory of a computer system. The task of moving from main memory to secondary memory is called swapping out.The task of moving back a swapped out process from secondary memory to main memory is known as swapping in. The swapping of processes is performed to ensure the best utilisation of main memory.

Short-Term Scheduler

It decides the priority in which processes is in the ready queue are allocated the central processing unit (CPU) time for their execution. The short term scheduler is also referred as central processing unit (CPU) scheduler.

Context Switch

A context switch is a procedure that a computer’s CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. Effective context switching is critical if a computer is to provide user-friendly multitasking.

Read more about Context Switch here.

Please Login/Signup to comment