CPU-SchedSim--CPU-Scheduling-Simulator-

CPU-SchedSim (CPU Scheduling Simulator) 🔗 Link

Overview
CPU-SchedSim is a C++-based CPU scheduling simulator designed to model and analyze various short-term CPU scheduling algorithms used in operating systems. It provides a controlled environment to evaluate scheduling strategies, measure performance, and understand process execution behavior.

Supported Scheduling Algorithms The simulator includes five major CPU scheduling algorithms, with a configurable context switch time of 14 milliseconds:

  1. First-Come, First-Served (FCFS) – Non-preemptive scheduling where the first arriving process gets executed first.
  2. Shortest-Job-First (SJF) (Non-Preemptive) – Executes processes with the shortest burst time first.
  3. Preemptive Shortest-Job-First (SJF) – Allows interruption when a shorter job arrives.
  4. Round-Robin (RR) – Time-slice-based scheduling with an adjustable time quantum (default: 200ms).
  5. Preemptive Priority Scheduling – Assigns random priority levels (0-4) to processes; lower values indicate higher priority. Higher-priority processes preempt lower-priority ones. If priorities match, Round-Robin scheduling is applied.

Process Generation & Arrival Times

Customizable Parameters

Key Features

Note:
No actual processes are forked. This is a pure simulation of CPU scheduling in an OS.

Installation

  1. Clone the repository:
    git clone https://github.com/anooragsingh07/process_simulator.git
  2. Navigate to the project directory:
    cd process_simulator
  3. Compile the program using g++:
    g++ -o process_simulator process_simulator.cpp
  4. Run the simulator:
    ./process_simulator

Usage

Future Improvements

Author
Anoorag Singh
📧 anooragsingh0007@gmail.com
🔗 GitHub