Skip to content

💾Implemented various CPU scheduling algorithms in C++ with arrival time (Operating Systems)

Notifications You must be signed in to change notification settings

ghulamghousdev/CPU-Scheduling-Algorithms

Repository files navigation

CPU Scheduling Algorithms



Implemented Algorithm

Implemented following CPU scheduling algorithms in C++ with same and different arrival time

  • First Come First Served
  • Shortest Job First
  • Round Robin
  • Priority Scheduling
  • Best Fit
  • First Fit
  • Bankers Algorithm

Features

Some of the features included are,

  • Concept of Arrival Time
  • Representation of individual process data like, Turn Around Time, Waiting Time etc.
  • Calculation of Average Turn Around Time and Waiting Time

First Come First Served

As the name suggests, the process which arrives first, will be served first.This scheduling algorithm is non- preemptive . Here, processes are sorted by their respective arrival time and then are executed. The process with lowest arrival time will get priority in execution.

Shortest Job First

Processes have their respective burst time, which suggests how much CPU time a process requires in order to get executed. This scheduling algorithm in Non- Preemptive . Here, the processes are first sorted with their respective arrival time. As soon the process arrives, it gets enqueued in a queue of arrived processes. The processes are executed in ascending order of their burst time in from the queue of arrived process.

Round Robin

Here, the process starvation is least as every process is executed in round robin fashion for a certain specified time quantum. Once a process is executed for the given time quantum, it leaves the CPU and gives turn to next process.

Priority Schedulig

Priority scheduling is a non-preemptive algorithm and one of the most common scheduling algorithms in batch systems. Each process is assigned a priority. Process with highest priority is to be executed first and so on. Processes with same priority are executed on first come first served basis.

Best Fit

The best fit deals with allocating the smallest free partition which meets the requirement of the requesting process. This algorithm first searches the entire list of free partitions and considers the smallest hole that is adequate. It then tries to find a hole which is close to actual process size needed.

First Fit

It is an memory allocation algorithm to different processes. First Fit Algorithm is the simplest technique of allocating the memory block to the processes amongst all. In this algorithm, the pointer keeps track of all the free blocks in the memory and accepts the request of allocating a memory block to the coming process

Bankers Algorithm

The banker’s algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.

About

💾Implemented various CPU scheduling algorithms in C++ with arrival time (Operating Systems)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published