Visualising and Simulating Processes under different Scheduling Algorithms in Cpp
.
for each algorithm : algorithms
, SchedSim
calculates:
- Gantt Chart
- Performance metrics like CPU usage, Throughput, Avg Waiting Time ...
- Waiting Time, Turnaround Time for each Process
- Shortest Job First
- Shortest Remaining Time First
- Round Robin
- Virtual Round Robin
Note
This project is compatible with Windows and Mac, CMakeLists.txt is provided and you can build it.
Note
Instructions below are only for Linux System
Prerequisite to build this project:
cmake
Simply execute the build.sh
on your device, in your terminal paste:
chmod +x build.sh
./build.sh
Compile Time Variable: LOG_LEVEL_SCHEDSIM (defaults to 0), setting this to 1 will LOG every scheduler decision to the std out.
cmake -DLOG_LEVEL_SCHEDSIM=1 .. # set the LOG_LEVEL_SCHEDSIM at compile time
The processes are read from the procs.proc
file, which must be present in the directory ./SchedSim
is being ran from. An example procs.proc
is provided by default in this project directory.
Format of the procs.proc
file:
ProcName;ArrivalTime;CPUBurstTime;IOBurstTime;IOBurstRate
std::string
ProcName: Name of the Processsize_t
ArrivalTime: Arrival Time of the Processsize_t
CPUBurstTime: No. of CPU Bursts of the Processsize_t
IOBurstTime: No. of IO Bursts of the Processsize_t
IOBurstRate: After how many CPU Bursts, the Process goes for IO.
SchedSim does not support mouse clicks(yet), but you can hover over Gantt Chart bursts to find its execution time.
SchedSim only supports vim motions like navigation.
j key
: Move to previous Tabk key
: Move to next Tabh key
: Move to previous Scheduling Algorithml key
: Move to next Scheduling Algorithm
Tip
You can also access a specific Tab by pressing the Tab number associated with that tab.
The Scheduler that implements all the algorithms was built here: SchedSim.cpp
The GUI implementation for the same was developed from scratch here: trials/SchedSim
Tip
TIP, I am the one who wants a tip. Enlighten me with why FetchContent_declare
takes years to perform git clone
of raysan5/raylib
. Even if the shallow clone is set to true. I couldn't understant anything that was argued about slow FetchContent on online forums. Although any clever workarounds for the same are aprreciated.
Including the entire source code and the build files of an external dependency in my project's source was the last thing i wanted to do, but here i am 😕