PROJECT STATUS: Core engine and scheduling algorithms are implemented and tested. Three interface versions are complete: CLI (command-line), TUI (terminal UI with ncurses), and GUI (graphical interface with GTK+3). The architecture and implementation are well-defined.
This project is a C-based multi-task scheduler simulator for a Linux-like environment. It allows users to experiment with different scheduling algorithms and analyze their performance with multiple visualization options.
- CLI Version: Command-line interface with text output
- TUI Version: Interactive terminal UI with real-time visualization using ncurses
- GUI Version: Graphical interface with cards and charts using GTK+3
- First-In, First-Out (FIFO)
- Last-In, First-Out (LIFO)
- Shortest Job First (SJF)
- Non-Preemptive Priority Scheduling
- Preemptive Priority Scheduling
- Shortest Remaining Time First (SRT)
- Round Robin (RR)
- Multi-level Feedback Queues (MLFQ)
The project is designed with a modular architecture, separating different concerns into the following components:
- Configuration Parser: Reads process definitions from a configuration file.
- Scheduler Engine: The core of the simulator, which manages the timeline, process states, and interacts with the scheduling policies.
- Policy Modules: Each scheduling algorithm is implemented as a separate module that adheres to a common policy interface.
- Data Structures: A set of generic data structures like queues, stacks, and heaps are used by the engine and policies.
- Output & Logging: Generates output in the form of Gantt charts and logs to visualize the scheduling process and its results.
Detailed documentation, including scrum plans and architectural notes, can be found in the docs/ directory.
The processes to be scheduled are defined in a configuration file. Each process is defined with its name, arrival time, burst time, and optionally, a priority.
Example:
process P1 {
arrival_time = 0
burst_time = 5
priority = 3
}
process P2 {
arrival_time = 2
burst_time = 8
priority = 1
}
process P3 {
arrival_time = 4
burst_time = 2
}
The basic command-line interface provides text-based output with Gantt charts and metrics.
./scheduler -c <config_file> [--verbose]Arguments:
-c, --config <config_file>: Path to the process configuration file (REQUIRED)--verbose: Enable verbose logging and detailed Gantt chart display (OPTIONAL)-h, --help: Display help message
Interactive Policy Selection: When you run the program, an interactive menu will be displayed allowing you to choose from the available scheduling policies:
- FIFO (First In, First Out)
- LIFO (Last In, First Out)
- SJF (Shortest Job First)
- Non-Preemptive Priority-based Scheduling
- Preemptive Priority-based Scheduling
- SRT (Shortest Remaining Time)
- RR (Round Robin) - will prompt for quantum value
Example Usage:
./scheduler -c configs/test1.conf
./scheduler -c configs/test1.conf --verboseThe TUI version provides an interactive, real-time visualization using ncurses with the following features:
- Real-time Process Visualization: Live view of running processes and ready queue
- Dynamic Gantt Chart: Scrollable timeline showing process execution
- Performance Metrics: Live updates of waiting time, turnaround time, and CPU utilization
- Interactive Controls:
SPACE: Pause/Resume simulation>: Increase simulation speed<: Decrease simulation speedR: Restart simulationQ: Quit
./tui_scheduler -c <config_file>Example Usage:
./tui_scheduler -c configs/test1.confThe GUI version provides a modern GTK+3 interface with card-based layout:
- Process Information Table: Detailed view of all processes with their states and metrics
- Execution Status Panel: Visual cards showing active process and ready queue
- Gantt Chart: Interactive timeline visualization
- Overall Metrics Dashboard: 2x2 grid with performance statistics
- Control Buttons: Start, Pause, Resume, Restart, and speed controls
./gui_scheduler -c <config_file>Example Usage:
./gui_scheduler -c configs/test1.confThe project is built using make. The following targets are available:
make allormake: Build theschedulerexecutable (CLI version)make tui: Build thetui_schedulerexecutable (TUI version with ncurses)make gui: Build thegui_schedulerexecutable (GUI version with GTK+3)
make test: Run the full test suitemake clean: Remove all build artifacts and executablesmake rebuild: Clean and rebuild the CLI versionmake run: Build and run the CLI version
CLI Version:
make all # Build CLI version
./scheduler -c configs/test1.confTUI Version:
make tui # Build TUI version
./tui_scheduler -c configs/test1.confGUI Version:
make gui # Build GUI version
./gui_scheduler -c configs/test1.conf- For CLI version: GCC compiler, standard C libraries
- For TUI version: ncurses library (
libncurses-devon Debian/Ubuntu) - For GUI version: GTK+3 development libraries (
libgtk-3-devon Debian/Ubuntu)
The project uses a set of custom data structures:
- Process: A struct to store process information (name, arrival time, burst time, priority, state, etc.).
- Queue: A generic FIFO queue.
- Stack: A generic LIFO stack.
- Heap: A min-heap and a max-heap for implementing priority queues.
New scheduling policies can be added by creating a new C file in the src/policies directory and a corresponding header in headers/policies. Each policy must implement the interface defined in headers/engine/policy_interface.h.
The simulator will generate the following outputs:
- Gantt Chart: An ASCII-based Gantt chart to visualize the execution of processes over time.
- Logs: Detailed logs of scheduling events (process arrival, preemption, termination).
- Metrics: Performance metrics such as average waiting time, average turnaround time, and throughput.
The project will have a test suite to verify the correctness of the scheduling algorithms and the simulator's behavior. The tests will be run using the make test command.
This project is licensed under the terms of the LICENSE file.



