SDT 302 - Assignment 2
By Andrii Tivonenko & Oleksii Ishchenko
This application is a CPU Scheduling Simulator with a GTK4-based graphical interface. It helps users understand how various CPU scheduling algorithms behave by simulating process scheduling with a clean visual UI.
- First-Come, First-Serve (FCFS)
- Shortest Job Next (SJN)
- Shortest Remaining Time (SRT)
- Round Robin (RR)
- Interactive GTK4 GUI
- Add and simulate custom processes
- Visual timeline of process execution
- GTK4 development libraries
- GCC
- A Unix-like OS (Linux/macOS recommended)
- Navigate to the project directory.
- Open a terminal and run the compile script:
./compile.sh
- This script will compile the source code and produce an executable file. You can then launch the application with:
./app
-
Start the Simulator: Launch the program. The main interface should appear.
-
Choose an Algorithm: Select one of the following:
- FCFS
- SJN
- SRT
- Round Robin (configure time quantum)
-
Add Processes: Enter the process details:
- Process ID/Name
- Arrival Time
- Burst Time
Click "Add Process" to queue it.
-
Run Simulation: Click "Start Simulation" to begin.
-
View Results: The scheduling timeline and results will be displayed visually.
- Non-preemptive
- Executes processes in the order they arrive
- Simple, but may cause long waits for short jobs
- Non-preemptive
- Picks the job with the shortest burst time
- Can lead to starvation for longer jobs
- Preemptive version of SJN
- Can interrupt a running job if a shorter one arrives
- More efficient, but complex logic
- Preemptive with time quantum
- Fair time-sharing model
- Each process gets CPU for a short slice (e.g., 2 seconds)
