Available Algorithms
The simulator implements five core CPU scheduling algorithms:- FIFO (First In First Out) - Simple queue-based scheduling
- SJF (Shortest Job First) - Optimizes for shortest execution time
- Round Robin - Time-sliced fair scheduling with quantum
- Priority Scheduling - Priority-based non-preemptive scheduling
- MLFQ (Multi-Level Feedback Queue) - Advanced multi-queue scheduling
Algorithm Comparison
| Algorithm | Type | Preemptive | Parameters | Best For |
|---|---|---|---|---|
| FIFO | Queue-based | No | Arrival time, CPU time | Simple batch processing |
| SJF | Shortest first | No | Arrival time, CPU time | Minimizing average waiting time |
| Round Robin | Time-sliced | Yes | Arrival time, CPU time, Quantum | Time-sharing systems |
| Priority | Priority-based | No | Arrival time, CPU time, Priority | Critical task handling |
| MLFQ | Multi-queue | Yes | Arrival time, CPU time, Quantum array | Complex interactive systems |
Key Metrics
All algorithms calculate the following performance metrics:- Start Time - When the process first begins execution
- Finish Time - When the process completes
- Waiting Time - Total time spent waiting in ready queue
- Turnaround Time - Total time from arrival to completion
- Total Time - Overall completion time for all processes
Waiting Time = Start Time - Arrival TimeTurnaround Time = Finish Time - Arrival Time
Choosing an Algorithm
Use FIFO when:
- Processes arrive in a predictable order
- Simplicity is more important than optimization
- Running batch jobs without time constraints
Use SJF when:
- Process execution times are known in advance
- Minimizing average waiting time is critical
- Running non-interactive batch processes
Use Round Robin when:
- Fair CPU time distribution is required
- Running interactive or time-sharing systems
- All processes should make progress regularly
Use Priority Scheduling when:
- Some processes are more critical than others
- You need control over execution order
- Real-time constraints exist for certain tasks
Use MLFQ when:
- Handling mixed workloads (interactive + batch)
- Want automatic priority adjustment
- Need sophisticated scheduling behavior