Scheduling is a fundamental function of operating systems, and CPU scheduling plays a crucial role in resource utilization and system performance. The CPU Schedulers Simulator is a Java program that simulates various CPU scheduling algorithms. This project aims to provide a better understanding of different scheduling algorithms and their impact on process execution.
The simulator currently implements the following CPU scheduling algorithms:
- Non-Preemptive Shortest-Job First (SJF) with context switching
- Shortest-Remaining Time First (SRTF) Scheduling with starvation prevention
- Non-preemptive Priority Scheduling with starvation prevention
-
AG Scheduling:
- Round Robin (RR) Scheduling with AG-Factor
- AG-Factor calculation based on a combination of priority, arrival time, burst time, and a random function
- Preemptive and non-preemptive scheduling based on AG-Factor
The simulator features a graphical user interface (GUI) that provides a Simple visual representation of the process execution order.
The CPU Schedulers Simulator allows you to input the necessary parameters for the simulation. These parameters include the number of processes, time quantum for round-robin scheduling, and context switching time. For each process, you provide the following details:
- Process Name
- Process Color (for graphical representation)
- Process Arrival Time
- Process Burst Time
- Process Priority Number (for priority scheduling)
The simulator outputs the execution order of processes, waiting times, turnaround times, average waiting time, average turnaround time, and history updates of quantum time for AG Scheduling. Additionally, it generates a graphical representation of the process execution order.
- Clone the repository:
git clone https://github.com/your-username/cpu-schedulers-simulator.git
- Compile the Java source files:
javac *.java
- Run the simulator:
java Main
Contributions to the CPU Schedulers Simulator project are welcome. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository.