Calculator Inputs
Example Data Table
| PID | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 14 |
| P2 | 1 | 6 |
| P3 | 3 | 10 |
| P4 | 5 | 4 |
| P5 | 6 | 9 |
Suggested queue setup: Q1 quantum 4, Q2 quantum 8, final queue FCFS, boost interval 20, and context switch cost 1.
Formula Used
Core MLFQ rule: New processes enter the highest-priority queue. A process that consumes its full time slice is demoted. A periodic boost can return waiting work to the top queue.
Turnaround Time: Turnaround = Completion Time − Arrival Time
Waiting Time: Waiting = Turnaround Time − CPU Burst Time
Response Time: Response = First Start Time − Arrival Time
Normalized Turnaround: Normalized Turnaround = Turnaround Time ÷ Burst Time
Throughput: Throughput = Number of Completed Processes ÷ Total Scheduling Span
CPU Utilization: CPU Utilization = Total Burst Time ÷ Total Scheduling Span × 100
This calculator simulates queue transitions step by step. It also tracks context-switch overhead, idle gaps, dispatch count, boost events, and final completion statistics.
How to Use This Calculator
- Enter feedback queue quantums as comma-separated values. Example: 4,8.
- Choose the final queue policy. Use FCFS or Round Robin.
- Add a final queue quantum only when Round Robin is selected.
- Set a boost interval to periodically restore higher priority.
- Enter context-switch overhead to reflect dispatcher cost.
- Type processes in the textarea using PID, arrival time, burst time.
- Click Calculate Scheduling to show results above the form.
- Use the CSV and PDF buttons to export the generated metrics.
Frequently Asked Questions
1. What does MLFQ scheduling try to optimize?
MLFQ balances fast response for short jobs and fair progress for longer jobs. Higher queues favor interactive work. Lower queues absorb CPU-heavy tasks without starving everything else.
2. Why do new jobs start in the top queue?
Starting at the highest queue gives each process a chance to finish quickly. Short jobs often complete there. Longer jobs gradually move downward after using full time slices.
3. What happens when a process uses its whole quantum?
The process is demoted to the next queue unless it is already in the last queue. That rule helps preserve responsiveness for newly arrived or short-running tasks.
4. Why is the boost interval important?
A priority boost prevents long jobs from waiting forever in low-priority queues. It periodically restores them to the top queue, improving fairness and reducing starvation risk.
5. Does context-switch cost change waiting time?
Yes. Extra dispatcher overhead increases overall elapsed time. That can raise waiting, turnaround, and completion times, especially when many short slices cause frequent preemption.
6. What is normalized turnaround used for?
Normalized turnaround compares completion delay against the original burst time. It helps evaluate fairness across jobs with very different lengths using one scaled measure.
7. Can the final queue be Round Robin?
Yes. This calculator supports either FCFS or Round Robin in the last queue. Round Robin keeps sharing CPU time, while FCFS lets the oldest remaining job finish first.
8. What does the Plotly graph show?
The first graph compares waiting, turnaround, and response time for each process. The second graph visualizes execution order, queue usage, idle gaps, and context-switch overhead.