leeshinyook | hs-krispy |
---|---|
We are students of Dankook University's software department. We are working on a project for the Cpu
scheduling algorithm.
Pull requests are always welcome.
-
include/lab_sched_types.h
This has structure of the process which has processName, arrivalTime etc. Create struct object in this file.
// lab_sched_types.h, Setinit2()
void SetInit2() {
v2[0].arriveTime = 0, v2[0].serviceTime = 4, v2[0].processName = 'A'
v2[1].arriveTime = 1, v2[1].serviceTime = 2, v2[1].processName = 'B'
v2[2].arriveTime = 5, v2[2].serviceTime = 6, v2[2].processName = 'C'
v2[3].arriveTime = 7, v2[3].serviceTime = 5, v2[3].processName = 'D'
v2[4].arriveTime = 10, v2[4].serviceTime = 3, v2[4].processName = 'E'
InitVariable();
}
If you need Stride algorithm, Add v2[0].ticket
. We have set the total number of stride repetitions to 100.
If you want to increase the number of iterations, increase the TC variable in the Stride function.
Also, We set the time quantum of RR and MLFQ to 1 and 2 or 1 and 4.
To adjust this time quantum, adjust each scheduling factor in the Run function section.(lab1_sched.cpp
)
-
lab1_sched.cpp
This has structure of functions(algorithm func, common func etc).
-
lab1_sched_test.cpp
This file has only one function.
void run()
. This function can make the whole function work.
We have set up a makefile for convenient code execution.
Since it is a file written in c++ lang, so g++
installation is required!
Also, make
installation is required, so please install it first.
$ git clone https://github.com/leeshinyook/Lab1-Sched.git
$ make
The make command creates an executable file. An executable file should have been created in your current directory.
If you want to delete the generated files, type make clean
$ ./lab1_sched