This project simulates various CPU scheduling algorithms. These algorithms are critical in operating systems for managing how processes access the CPU. The implemented scheduling methods are:
- Shortest Remaining Time First (SRTF)
- First Come First Serve (FCFS)
- Round Robin (RR)
- Shortest Job First (SJF)
- Shortest Process Next (SPN)
- Non-preemptive Priority Scheduling
This project allows you to understand and visualize how different CPU scheduling algorithms work. By simulating these algorithms, you can compare their performance based on metrics such as average waiting time and turnaround time.
FCFS is the simplest scheduling algorithm. In this method, the process that arrives first gets executed first. It operates in a non-preemptive manner.
For more details, visit the FCFS Documentation.
RR scheduling assigns a fixed time unit per process, and cycles through them. It is designed to be fair, giving each process a chance to run.
For more details, visit the Round Robin Documentation.
SJF, also known as SPN, selects the process with the smallest burst time to execute next. This can be non-preemptive or preemptive.
For more details, visit the SJF Documentation and the SPN Documentation.
SRTF is a preemptive version of SJF. It selects the process with the smallest remaining time to execute next.
For more details, visit the SRTF Documentation.
In this method, each process is assigned a priority. The CPU is allocated to the process with the highest priority (the smallest priority number).
For more details, visit the Priority Scheduling Documentation.
The output of each scheduling algorithm is verified using an external tool for accuracy.
- Install Rust from the official Rust website.
-
Compile the Code:
rustc main.rs
-
Run the Executable:
./main.exe
If you want to contribute to this project, please fork the repository and submit a pull request with your improvements.