Thread Scheduler Visualizer is a cross-platform desktop application designed to model, simulate, and analyze operating system thread scheduling algorithms in real time. Built with C++17 and Qt/QML, it provides an intuitive graphical interface for examining CPU scheduling mechanics, context switches, and performance metrics.
- Core Scheduling Algorithms: Out-of-the-box support for First-Come, First-Served (FCFS) and Round Robin (RR) scheduling policies.
- Real-Time Simulation & Control: Interactive timeline control with play, pause, and timer adjustments.
- Comprehensive Metrics: Live tracking of Turnaround Time, Waiting Time, Response Time, and CPU Utilization.
- Cross-Platform GUI: Native desktop experience across Windows and Linux, featuring vectorized icons and clean window architecture without unwanted console popups.
- Robust Containerized Environment: Docker support and GitHub Actions CI pipelines ensuring reproducible builds and automated testing.
- Language: C++17
- Framework: Qt 5 (Core, GUI, Qml, Quick, Svg)
- Build System: CMake (>= 3.16), Ninja
- Testing: GoogleTest
- CI/CD & Virtualization: GitHub Actions, Docker (Ubuntu 22.04 LTS)
Before building the project, ensure your system has the following dependencies installed:
- C++ Compiler supporting C++17 (MSVC 2019+, GCC 11+, or Clang)
- CMake (version 3.16 or higher)
- Qt 5 development libraries
- On Ubuntu/Debian:
sudo apt-get install build-essential cmake qtbase5-dev qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick2
- On Ubuntu/Debian:
- Clone the repository
- Configure the project with CMake:
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
- Build the application:
cmake --build build --config Release
- Run the executable:
- Windows:
build\Release\thread_scheduler_visualizer.exe - Linux:
./build/thread_scheduler_visualizer
- Windows:
The project includes unit tests for core scheduling algorithms using GoogleTest. To run them:
- Build with tests enabled (
-DBUILD_TESTS=ON). - Execute tests via CTest:
ctest --test-dir build --output-on-failure
If you prefer an isolated environment or want to run automated tests and execute the GUI application via Docker:
- Build the Docker image (this will automatically compile the project and run all unit tests via CTest):
docker build --no-cache -t thread-scheduler-visualizer -f docker/Dockerfile .
- Run the application with GUI support (X11 / XLaunch):
- On Windows (make sure XLaunch / VcXsrv is running with «Disable access control» enabled):
docker run --rm -it ` -e DISPLAY="host.docker.internal:0.0" ` -v /tmp/.X11-unix:/tmp/.X11-unix ` thread-scheduler-visualizer ` ./build/thread_scheduler_visualizer - On Linux:
xhost +local:docker docker run --rm -it \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ thread-scheduler-visualizer \ ./build/thread_scheduler_visualizer
- On Windows (make sure XLaunch / VcXsrv is running with «Disable access control» enabled):
- Launch the application.
- Select the desired scheduling algorithm (FCFS or Round Robin) from the interface controls.
- Configure thread parameters (burst time, arrival time, etc.).
- Use the playback controls to observe the real-time simulation timeline and context switches.
- Review the calculated performance metrics in the analytics panel.
Distributed under the MIT License. See LICENSE for more information.
- Glossary — Definitions for core OS scheduling terminology, thread states, and architectural components.
thread-scheduler-visualizer/
├── .github/
│ └── workflows/
│ ├── ci.yml # GitHub Actions CI pipeline
│ ├── readme-check.yml # Auto-check README updates on structure changes
│ └── release.yml # Automated release workflow
├── docker/
│ └── Dockerfile # Linux build environment container
├── include/
│ ├── core/
│ │ ├── FCFSScheduler.h # First-Come, First-Served algorithm interface
│ │ ├── PCB.h # Process Control Block class interface
│ │ ├── Scheduler.h # Abstract base scheduler interface
│ │ ├── Thread.h # Thread structure & ThreadState enum
│ │ └── RRScheduler.h # Round Robin algorithm interface
│ └── gui/
│ └── GUIController.h # Qt/QML bridge & ViewModel interface
├── resources/
│ ├── icons/
│ │ ├── app_icon.ico # Windows multi-resolution icon
│ │ └── app_icon.svg # Cross-platform vector icon source
│ ├── app.rc # Qt resource file for icon mapping
│ └── preview/
│ └── screenshot.png # Preview screenshot for README
├── src/
│ ├── core/
│ │ ├── FCFSScheduler.cpp # FCFS algorithm implementation
│ │ ├── PCB.cpp # PCB implementation
│ │ ├── Thread.cpp # Thread helpers implementation
│ │ └── RRScheduler.cpp # Round Robin algorithm implementation
│ ├── gui/
│ │ └── GUIController.cpp # ViewModel implementation & Qt bindings
│ ├── main.cpp # Entry point / Cross-platform icon loader
│ ├── qml.qrc # Qt resource bundle for QML assets
│ └── main.qml # Main application window & QML UI layout
├── tests/
│ └── unit/
│ ├── TestThreadFSM.cpp
│ ├── test_fcfs_scheduler.cpp
│ └── test_rr_scheduler.cpp
├── CMakeLists.txt # Root CMake build configuration (with Qt6Svg)
├── CMakePresets.json # Standard CMake build presets
├── GLOSSARY.md # Project domain glossary & technical definitions
├── LICENSE # License file
├── resources.qrc # Qt resource bundle (icons mapping)
├── .gitignore # Git ignore rules
└── README.md # Project documentation
