/cpu-scheduler

A Java program to implement the CPU scheduling algorithms.

Primary LanguageJava

CPU Scheduler

This is a Java program to simulate the following CPU Scheduling algorithms.

  1. First Come First Serve
  2. Round Robin
  3. Shortest Job First (Preemptive)
  4. Shortest Job First (Non-Preemptive)
  5. HRRN
  6. Lottery
  7. Earliest Deadline First
  8. Priority

I calculate the following values for each algorithm, generated in a .txt file with algorithm's name.

  • Arrival Time
  • Burst Time
  • Waiting Time
  • Turnaround Time
  • Response Time
  • Completion Time
  • CPU Utilisation
  • Average Waiting Time
  • Average Turnaround Time
  • Average Response Time

I also generate a Gaant chart using python in form of a SVG for the algorithms.

Sample data can be found in /samples

main

Gaant Charts

First Come First Serve

FCFS


Highest Response Ratio Next

HRRN


Priority

P


Round Robin

RR


Shortest Job First (Non-Preemptive)

SJF


Shortest Job First (Preemptive)

SJFN