process scheduling algorithm in os

A Process Scheduler uses various process scheduling algorithm in os to schedules different processes.There are various scheduling algorithms. used by the scheduler. example are FCFS, Shortest-Job-Next (SJN) Scheduling, Priority Scheduling, Shortest Remaining Time, Round Robin(RR) Scheduling, Multiple-Level Queues Scheduling

what is a process scheduling algorithm in os

The process scheduling algorithm in os handles the removal of the running process from the CPU and the select another process from the CPU on the basis of a different strategy.

why we need scheduling

In multiprogramming systems, one process can use CPU while another is waiting for I/O. This is possible only with process scheduling.

Some important Definition

Preemptive scheduling-it is based on priority where a scheduler may preempt a low priority process anytime when a high priority process enters into a ready state.

Non-preemptive – it is based on that once a process enters the running state, it cannot be preempted until it completes its allotted time.

How many types of Scheduling Algorithm.

  • First-Come-First-Served
  • Shortest-Job-First
  • Priority Scheduling
  • Round Robin
  • Multiple-Level Queues

process scheduling algorithm in os

Scheduling Algorithm

Also, read this:- Banker’s algorithm |Banker’s algorithm using C|deadlock avoidance

I will discuss all one by one:-

What is First-Come-First-Served Process?

First-come-first-served, in FCFS the process which arrived first will always execute first, it is a non-preemptive scheduling algorithm so that if high priority process will come it will not preempt because FCFS doesn’t consider Priority.the problem with First-Come-First-Served is that if high priority process comes first other processes have to wait till the termination of the process so in case of FCFS Starvation is possible and also have a high Average waiting Time.

What is Shortest-Job-First?

Shortest-job-First, SJF is a scheduling algorithm that picks the quickest fastest little job that needs to be done, get it out of the way first, and then pick the next smallest fastest job to do next and so on.

Technically this algorithm picks a process based on the next shortest CPU burst, not the overall process time.

Shortest job first can be either preemptive or non-preemptive. Owing to its simple nature, shortest job first is considered optimal.

It also reduces the average waiting time for other processes awaiting execution.
Shortest job first is also known as the shortest job next (SJN) and shortest process next (SPN).

also, read this:-  Deadlock OS | Deadlock | starvation

What is Priority Scheduling?

In priority scheduling. Each process in the system is given a priority, then the scheduling must be done according to the priority of each process. A higher priority job should get CPU whereas lower priority job can be made to wait. if two process has same priority then scheduling will be done using FCFS. Priority scheduling is necessarily a form of preemptive scheduling where priority is the basis of preemption.

what is Round Robin Scheduling algorithm?

Round Robin scheduling algorithm is a where each process is assigned a fixed time slot in a cyclic way.It is simple, easy to implement, and starvation-free as all processes get the fair share of CPU.One of the most commonly used technique in CPU scheduling as a core.It is preemptive as processes are assigned CPU only for a fixed slice of time at most.The disadvantage of it is more overhead of context switching.

Multiple-Level Queues

Multilevel queue scheduling was created for the situation in which processes are easily classified into different groups.

Multilevel queue scheduling has the following characteristics:

  • Processes are divided into the different queue based on their type. The process is permanently assigned to one queue, generally based on some property of process i.e. system process, interactive, batch system, end user process, memory size, process priority and process type.
  • Each queue has its own scheduling algorithm. For example, interactive process may use round-robin scheduling method, while batch job uses the FCFS method.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *