Skip to content

Offliners/CPU-SCHEDULING-Algorithms

Repository files navigation

CPU SCHEDULING Algorithms

Usage

$ make                                       // compile all program
$ sudo ./time                                // calaulate the period of a time unit
$ sudo ./scheduler < data/FCFS_1.txt         // test the first data of FCFS
$ ./calc < data/FCFS_1.txt                   // calculate the the preiod of the first data of FCFS
$ sudo sh time.sh                            // calculate the period of all ideal cases and real cases
$ python ganttChart_plot.py                  // plot the gantt chart of all scheduling algorithms
$ 

FCFS

FCFS_1

Process Arrive time Burst time
P1 0 1000
P2 0 1000
P3 0 1000
P4 0 1000
P5 0 1000

FCFS_1

FCFS_2

Process Arrive time Burst time
P1 0 80000
P2 100 5000
P3 200 1000
P4 300 1000

FCFS_2

FCFS_3

Process Arrive time Burst time
P1 0 8000
P2 200 5000
P3 300 3000
P4 400 1000
P5 500 1000
P6 500 1000
P7 600 4000

FCFS_3

FCFS_4

Process Arrive time Burst time
P1 0 2000
P2 500 500
P3 500 200
P4 1500 500

FCFS_4

FCFS_5

Process Arrive time Burst time
P1 0 8000
P2 200 5000
P3 200 3000
P4 400 1000
P5 400 1000
P6 600 1000
P7 600 4000

FCFS_5

SJF

SJF_1

Process Arrive time Burst time
P1 0 5000
P2 0 2500
P3 200 1000
P4 300 2000

SJF_1

SJF_2

Process Arrive time Burst time
P1 100 100
P2 100 4000
P3 200 200
P4 200 4000
P5 200 7000

SJF_2

SJF_3

Process Arrive time Burst time
P1 100 3000
P2 100 5000
P3 100 7000
P4 200 10
P5 200 10
P6 300 4000
P7 400 4000
P8 500 9000

SJF_3

SJF_4

Process Arrive time Burst time
P1 0 3000
P2 1000 1000
P3 2000 4000
P4 5000 2000
P5 7000 1000

SJF_4

SJF_5

Process Arrive time Burst time
P1 0 2000
P2 500 500
P3 1000 500
P4 1500 500

SJF_5

PSJF

PSJF_1

Process Arrive time Burst time
P1 0 5000
P2 0 2500
P3 200 1000
P4 300 2000

PSJF_1

PSJF_2

Process Arrive time Burst time
P1 0 3000
P2 1000 1000
P3 2000 4000
P4 5000 2000
P5 7000 1000

PSJF_2

PSJF_3

Process Arrive time Burst time
P1 0 2000
P2 500 500
P3 1000 500
P4 1500 500

PSJF_3

PSJF_4

Process Arrive time Burst time
P1 0 7000
P2 0 2000
P3 100 1000
P4 200 4000

PSJF_4

PSJF_5

Process Arrive time Burst time
P1 100 100
P2 100 4000
P3 200 200
P4 200 5000
P5 200 7000

PSJF_5

RR

RR_1

Process Arrive time Burst time
P1 0 1000
P2 0 1000
P3 0 1000
P4 0 1000
P5 0 1000

RR_1

RR_2

Process Arrive time Burst time
P1 600 4000
P2 800 5000

RR_2

RR_3

Process Arrive time Burst time
P1 1200 5000
P2 2400 4000
P3 3600 3000
P4 4800 7000
P5 5200 6000
P6 5800 5000

RR_3

RR_4

Process Arrive time Burst time
P1 0 8000
P2 200 5000
P3 300 3000
P4 400 1000
P5 500 1000
P6 500 1000
P7 600 4000

RR_4

RR_5

Process Arrive time Burst time
P1 0 8000
P2 200 5000
P3 200 3000
P4 400 1000
P5 400 1000
P6 600 1000
P7 600 4000

RR_5

Linux Kernel

  • linux-4.10.13

Reference

https://sls.weco.net/node/21325

https://github.com/wangyenjen/OS-Project-1

https://blog.kaibro.tw/2016/11/07/Linux-Kernel%E7%B7%A8%E8%AD%AF-Ubuntu/

About

Implement CPU scheduling algorithms (FCFS, SJF, RR and PSJF)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published