An interactive web-based simulator that visualizes and demonstrates various CPU scheduling algorithms in operating systems. This educational tool allows users to understand how different scheduling algorithms work and compare their performance in real-time.
Visit the live application: cpu-scheduling-simulator-blue.vercel.app
- Interactive Process Creation: Add custom processes with specific arrival and burst times
- Multiple Scheduling Algorithms:
- First-Come, First-Served (FCFS)
- Shortest Job Next (SJN)
- Shortest Remaining Time First (SRTF)
- Round Robin (RR) with configurable time quantum
- Real-time Visualization: Watch processes move through the ready queue to CPU execution
- Live Performance Metrics: Track waiting time, turnaround time, and throughput as simulation runs
- Comparative Analysis: Side-by-side comparison of algorithm performance on the same process set
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
No special prerequisites required! This is a pure HTML/CSS/JavaScript application that runs directly in the browser.
- Clone the repository
git clone https://github.com/yourusername/cpu-scheduling-simulator.git- Navigate to the project directory
cd cpu-scheduling-simulator- Open
index.htmlin your web browser
# On macOS
open index.html
# On Linux
xdg-open index.html
# On Windows
start index.htmlAlternatively, use a local development server:
# Using Python 3
python -m http.server 8000
# Using Node.js http-server
npx http-servercpu-scheduling-simulator/
│
├── index.html
├── README.md
├── LICENSE
├── .gitignore
│
├── assets/
│ ├── css/
│ │ ├── style.css
│ │ ├── animations.css
│ │ └── responsive.css
│ ├── js/
│ │ ├── main.js
│ │ ├── scheduler.js
│ │ ├── process.js
│ │ ├── queue.js
│ │ ├── visualizer.js
│ │ ├── metrics.js
│ │ ├── utils.js
│ │ └── algorithms/
│ │ ├── fcfs.js
│ │ ├── sjn.js
│ │ ├── srtf.js
│ │ └── roundrobin.js
│ └── images/
│ ├── icons/
│ └── screenshots/
│
├── components/
│ ├── input-form.html
│ ├── visualization.html
│ └── metrics-panel.html
│
├── docs/
│ ├── README.md
│ ├── algorithm-guide.md
│ └── user-manual.md
│
└── tests/
├── test-data.js
└── algorithm-tests.js
- Add Processes: Enter arrival time and burst time for each process
- Select Algorithm: Choose from FCFS, SJN, SRTF, or Round Robin
- Configure Settings: For Round Robin, set the time quantum
- Run Simulation: Click "Start Simulation" to watch the visualization
- Analyze Results: View performance metrics and compare algorithms
Processes are executed in order of arrival. Simple but can cause long waiting times for short processes.
Non-preemptive algorithm that executes the process with the shortest burst time next. Minimizes average waiting time but may cause starvation.
Preemptive version of SJN. The process with the smallest remaining time is executed next.
Each process receives a fixed time quantum. Provides fair CPU allocation and good response time for interactive systems.
- Turnaround Time: Total time from process submission to completion
- Waiting Time: Time spent waiting in the ready queue
- Response Time: Time from arrival to first CPU allocation
- Throughput: Number of processes completed per unit time
- CPU Utilization: Percentage of time CPU is actively executing processes
- HTML5
- CSS3
- Vanilla JavaScript
- No external dependencies or frameworks required
- Pachatya Darsan Gohain [RA2411030010262]
- Ramesh Harisabapathi Chettiar [RA2411030010263]
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For questions or feedback, please open an issue on GitHub.
- Inspired by operating systems course curriculum
- Built as an interactive learning showcase project
- Special thanks to educators and students in the OS community
Note: This is an educational project designed to help students understand CPU scheduling algorithms through interactive visualization.