02 / Case study

CPU Scheduling Simulator

C-based CPU scheduling simulator that runs FCFS, SJF/SRTF, Round Robin, and preemptive or non-preemptive Priority scheduling, then outputs Gantt charts and process timing metrics.

CMakePythonTkinter
01

Overview

I contributed to a CPU scheduling simulator that makes process-order decisions visible instead of treating scheduling as a black box. It accepts manual or generated process data and reports execution order, waiting time, turnaround time, and CPU utilization for comparison.

Input modesManual and generated process data support repeatable simulations.
Timing metricsWaiting time, turnaround time, and CPU utilization make runs comparable.
02

Contribution

I implemented the FCFS Gantt-chart output and SJF/SRTF logic, then added CPU-utilization calculations for FCFS, SJF, Round Robin, and Priority. I also worked within the team’s shared C structure for algorithm execution, formatted output, and repeated simulation runs.

Gantt outputFCFS execution order is rendered as a chart for inspection.
Utilization comparisonCPU-utilization calculations span FCFS, SJF, Round Robin, and Priority.
03

Implementation

I used C structs and separate source files for FCFS, SJF/SRTF, Round Robin, Priority, formatting, random input, and output handling. The command-line flow validates inputs, supports manual or random processes and preemptive choices, writes Gantt charts and tables to output.txt, and uses result.py to compare selected algorithms in a Tkinter window.

Algorithm modulesSeparate C files organize FCFS, SJF/SRTF, Round Robin, and Priority logic.
Repeatable runsManual or random inputs can be combined with preemptive choices.
Output filesGantt charts and timing tables are written to output.txt.
Comparison windowresult.py uses Tkinter to compare selected algorithm results.
Terminal run of the CPU Scheduling Simulator showing SJF selection, generated processes, a Gantt chart, and timing metrics.
Terminal run: SJF output with generated processes, a Gantt chart, and process timing metrics.
Tkinter comparison window showing a Gantt chart and average waiting and turnaround times.
Comparison view: the Python tool presents Gantt output and average waiting and turnaround times.
04

Outcome & Reflection

The repository calculates waiting time, turnaround time, and CPU utilization and writes the results for comparison; it does not report a measured performance result or user outcome. I would keep the algorithm-per-file structure and next verify the build from a clean checkout with repeatable edge-case inputs for idle CPU time and tie-breaking.

Next project

Church App KPI Tracker

Read next case study