This project involves the implementation and simulation of three CPU scheduling algorithms: FCFS non-preemptive, SJF non-preemptive, and Round Robin. The primary objective is to gain hands-on experience in OS scheduling through simulation programming.
- FCFS non-preemptive:
- SJF non-preemptive:
- Round Robin (non-preemptive):
- Processes arrrive at time 0.
- Processes dont wait I/O devices.
- After /O event, a process moves back to the ready queue.
To run the simulation, follow these steps:
-
Open the
main.cpp
file in thesrc
directory. -
Locate the
p_data
variable and input your burst sequence for the desired process. For example:// main.cpp int p_data[] = { {1, 2, 3, 5}, {2, 4, 5, 7}, {.2, 6, 7}, ... };
-
Save the
main.cpp
file. -
Open the
tasks.json
file in your Visual Studio Code workspace (.vscode
directory). -
Ensure that the
args
property within the"tasks"
array looks like the following:"args": [ "-fdiagnostics-color=always", "-g", "${workspaceFolder}/*.cpp", "-o", "fileDirname{fileDirname}\\{fileBasenameNoExtension}.exe" ],
-
Save the
tasks.json
file. -
Build and Run