Interactive visualization tool for CPU scheduling algorithms with beautiful UI, real-time simulations, and comprehensive metrics.
- 4 Single-Core Algorithms: FCFS, SJF, Round Robin, Priority
- 4 Dual-Core Algorithms: All algorithms with load balancing
- Real-Time Visualization: Gantt charts, animations, and metrics
- Algorithm Comparison: Run all algorithms simultaneously
- Performance Metrics: Waiting time, turnaround time, CPU utilization
- Random Process Generator: Instant test data generation
- Modern Design: Gradient backgrounds, smooth animations, emojis
- Dark/Light Mode: Complete theme support
- Responsive Layout: Works on desktop, tablet, mobile
- Interactive Controls: Real-time process editor
- Professional Charts: Chart.js visualizations
- Live Updates: Instant visual feedback
- Instant Calculations: <1ms for 100 processes
- Optimized Bundle: Only ~200KB gzipped
- Zero Latency: Client-side architecture
- Smooth Animations: 60fps transitions
./build.sh # Build all components
./start.sh # Start all services
# Open http://localhost:3000Terminal 1 - C++ Backend:
cd cpp && mkdir -p build && cd build
cmake .. && makeTerminal 2 - Node.js API:
cd api
npm install
node server.js
# Runs on http://localhost:3001Terminal 3 - Frontend:
cd frontend
npm install
npm run dev
# Opens http://localhost:3000βββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js + React) β
β - Beautiful UI/UX β
β - Real-time visualization β
β - Interactive controls β
βββββββββββββββ¬ββββββββββββββββββββββββ
β HTTP REST API
βββββββββββββββΌββββββββββββββββββββββββ
β Backend (Node.js + Express) β
β - API routing β
β - Process spawning β
β - Data formatting β
βββββββββββββββ¬ββββββββββββββββββββββββ
β IPC / Stdio
βββββββββββββββΌββββββββββββββββββββββββ
β Core (C++ Executables) β
β - Scheduling algorithms β
β - High-performance computation β
β - Process simulation β
βββββββββββββββββββββββββββββββββββββββ
- Complexity: O(n)
- Best For: Simple workloads
- Characteristics: Non-preemptive, FIFO queue
- Complexity: O(n log n)
- Best For: Minimizing waiting time
- Characteristics: Optimal for waiting time
- Complexity: O(n)
- Best For: Fair scheduling, time-sharing
- Characteristics: Preemptive, time quantum based
- Complexity: O(n)
- Best For: Real-time systems
- Characteristics: Priority queue based
- Gradient backgrounds with smooth animations
- Color-coded metrics (blue, purple, amber, green)
- Responsive grid layout
- Professional typography
- Light mode with bright gradients
- Dark mode with slate colors
- Smooth theme transitions
- Full accessibility
- Real-time process table editor
- Drag-to-sort capabilities
- Instant data validation
- Visual feedback on interactions
- Animated Gantt charts
- Performance metric cards
- CPU utilization graphs
- Memory usage gauges
- Comparison tables
Run single-core scheduling
{
"algorithm": "FCFS",
"processes": [{ "id": 1, "arrivalTime": 0, "burstTime": 5, "priority": 1 }]
}Run dual-core scheduling
{
"algorithm": "DualCoreFCFS",
"processes": [...],
"timeQuantum": 2
}Compare all algorithms
{
"processes": [...],
"timeQuantum": 2
}Generate random processes
- Node.js 18+
- npm 9+
- C++17 compiler (g++ or clang)
- CMake 3.10+
- macOS/Linux (tested on both)
- Clone Repository
git clone <repo-url>
cd OS-Project- Install Dependencies
cd frontend && npm install
cd ../api && npm install- Build C++ Backend
cd cpp
mkdir -p build && cd build
cmake ..
make
cd ../..- Set Environment Variables (optional)
export NEXT_PUBLIC_API_URL=http://localhost:3001-
Configure Processes
- Manually enter process details
- OR use random generator
- Set arrival times, burst times, priorities
-
Select Algorithm
- Choose from 4 algorithms
- Set time quantum (for Round Robin)
- Toggle single-core/dual-core/compare modes
-
Run Simulation
- Click "Run Schedule" button
- Watch Gantt chart animate
- View performance metrics
-
Analyze Results
- Compare average waiting time
- Compare average turnaround time
- Analyze total execution time
- View CPU utilization
-
Compare All
- Run all algorithms simultaneously
- Side-by-side comparison
- Identify best algorithm for workload
OS Project/
βββ π¨ frontend/ # Next.js + React + TypeScript
β βββ app/
β β βββ page.tsx # Main page
β β βββ layout.tsx # Root layout
β β βββ globals.css # Global styles
β βββ components/ # 12+ React components
β βββ types/ # TypeScript definitions
β βββ package.json
β
βββ π₯οΈ api/ # Node.js + Express
β βββ server.js # API server
β βββ package.json
β
βββ βοΈ cpp/ # C++ Core Engine
β βββ src/ # Source files
β βββ build/ # Compiled binaries
β βββ CMakeLists.txt
β
βββ π Documentation
β βββ README.md # This file
β βββ QUICKSTART.md # Quick start
β βββ PROJECT_STRUCTURE.md # Detailed structure
β βββ FRONTEND_IMPROVEMENTS.md
β
βββ π οΈ Scripts
β βββ build.sh # Build everything
β βββ start.sh # Start services
β
βββ π Configuration
βββ .gitignore
βββ package.json (root)
AlgorithmSelector- Algorithm & mode selectionProcessInput- Process table editorGanttChart- Single-core Gantt visualizationDualCoreGanttChart- Dual-core visualizationMetricsTable- Performance metricsComparisonTable- Algorithm comparisonCPUUtilizationChart- CPU usage graphMemoryGauge- Memory usage widgetRandomDataGenerator- Test data generatorThemeToggle- Dark/Light mode switchThemeProvider- Theme contextComparisonView- Comparison layout
- Single-Core: FCFS, SJF, RoundRobin, Priority
- Dual-Core: DualCoreFCFS, DualCoreSJF, DualCoreRoundRobin, DualCorePriority
- Utilities: Process, Scheduler, ProcessGenerator
| Metric | Value |
|---|---|
| Frontend Bundle | ~200KB (gzipped) |
| Calculation Time (10 processes) | <1ms |
| Calculation Time (100 processes) | <5ms |
| UI Response Time | <16ms (60fps) |
| Memory Usage | ~50MB |
| Startup Time | ~2s |
After using this tool, you'll understand:
- β How CPU scheduling algorithms work
- β Trade-offs between different algorithms
- β Impact of time quantum on Round Robin
- β Importance of priority levels
- β Metrics: waiting time, turnaround time
- β Dual-core load balancing
- β Context switching overhead
Contributions welcome! Areas for improvement:
- Export results as PDF/CSV
- Save/load simulations
- More scheduling algorithms
- Mobile app version
- Performance benchmarking tools
MIT License - Feel free to use in personal/educational projects
- React 18 - UI library
- Next.js 14 - React framework
- TypeScript 5.2 - Type safety
- Tailwind CSS 3.3 - Styling
- Chart.js 4.4 - Data visualization
- Node.js 18 - Runtime
- Express.js - Web framework
- C++17 - Core algorithms
- CMake - Build system
For issues, questions, or suggestions:
- Check existing documentation
- Review code comments
- Create an issue in repository
Built as an educational project to visualize and understand CPU scheduling algorithms in operating systems.
Status: Production Ready β Last Updated: January 2026 Version: 1.0.0
Happy Scheduling! π
- C++ Compiler: GCC/Clang with C++17 support
- CMake: Version 3.10 or higher
- Node.js: Version 18 or higher
- npm or yarn
cd cpp
mkdir -p build
cd build
cmake ..
makeThe compiled binary will be at cpp/build/bin/scheduler.
cd api
npm installcd frontend
npm installStart both servers with one command:
./start.shThis will start:
- API server on
http://localhost:3001 - Frontend on
http://localhost:3000
Press Ctrl+C to stop both servers.
- Start the API server (in one terminal):
cd api
npm run devThe API will run on http://localhost:3001
- Start the Next.js frontend (in another terminal):
cd frontend
npm run devThe frontend will run on http://localhost:3000
- Build the frontend:
cd frontend
npm run build
npm start- Start the API server:
cd api
npm start- Configure Processes: Add processes with their arrival time, burst time, and priority (if needed)
- Select Algorithm: Choose a scheduling algorithm (or compare all)
- Set Time Quantum: For Round Robin, specify the time quantum
- Run Schedule: Execute the algorithm and view results
- View Results:
- Gantt chart showing process execution timeline
- Performance metrics table
- Comparison view (when comparing all algorithms)
Schedule processes using a single algorithm.
Request Body:
{
"algorithm": "FCFS",
"timeQuantum": 2,
"processes": [
{ "id": 1, "arrivalTime": 0, "burstTime": 5, "priority": 2 },
{ "id": 2, "arrivalTime": 1, "burstTime": 3, "priority": 1 }
]
}Response:
{
"ganttChart": [...],
"processes": [...],
"avgWaitingTime": 2.5,
"avgTurnaroundTime": 5.0,
"totalTime": 8
}Compare all algorithms with the same process set.
Request Body:
{
"timeQuantum": 2,
"processes": [...]
}Response:
{
"FCFS": {...},
"SJF": {...},
"RoundRobin": {...},
"Priority": {...}
}- Non-preemptive
- Processes executed in order of arrival
- Simple but may have high waiting times
- Non-preemptive
- Process with shortest burst time executes first
- Optimal for minimizing average waiting time
- Preemptive
- Each process gets a time quantum
- Fair scheduling, prevents starvation
- Non-preemptive
- Process with highest priority (lowest number) executes first
- Priority can be static or dynamic
- C++: Core scheduling algorithms
- Node.js/Express: API bridge
- Next.js 14: React framework
- Chart.js: Data visualization
- Tailwind CSS: Styling
- TypeScript: Type safety
MIT
Contributions are welcome! Please feel free to submit a Pull Request.