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

anmol-tripathi/CPU-Scheduling-Algorithms

Repository files navigation

CPU Scheduling Algorithms


Co-creator: @leonatwork
Dated: 01st November 2019

Implemented following CPU scheduling algorithms in C++ with arrival time

  • First Come First Served
  • Shortest Job First
  • Round Robin
  • Shortest Job Remaining First

Some of the features included are,
- Concept of Arrival Time
- Random generation of Process data
- Tabular 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. This process is Preemptive .

Shortest Job Remaining First

It is the preemptive implementation of the algorithm Shortest job first. As soon as, a job arrives having lesser burst time than the current executing process, CPU preempts the current executing process and fetchs the one with the least burst time.

Working Snapshots





Releases

No releases published

Packages

No packages published

Languages