Loading subject…
Scheduling
Scheduling is the process of allocating CPU time to various processes to optimize system performance.
First-Come, First-Served (FCFS)
Processes are executed in the order they arrive, with no pre-emption.
Round Robin
Each process receives a fixed time slice (quantum) in a cyclic order.
Multilevel Queue Scheduling
Divides the ready queue into multiple queues, each with its own scheduling algorithm and priority.
Priority Scheduling
Assigns a priority to each process, with the CPU allocated to the highest-priority process.
| Measure | First-come, first-served | Round robin, quantum 4 ms |
|---|---|---|
| Order of execution | P1 (0-24), P2 (24-27), P3 (27-30) | P1, P2, P3, then P1 to completion |
| Waiting time P1 | 0 ms | 6 ms |
| Waiting time P2 | 24 ms | 4 ms |
| Waiting time P3 | 27 ms | 7 ms |
| Average waiting time | 17 ms | 5.67 ms |
| Average turnaround time | 27 ms | 15.67 ms |
| Process switches | 2 | 3 |
| Approach | Preemptive | Fairness and starvation | Efficiency and switching cost |
|---|---|---|---|
| First-come, first-served | No | No process is overtaken, but short jobs suffer the convoy effect | Lowest switching cost, worst average waiting time with mixed job lengths |
| Round robin | Yes | Every process is served within one pass, so starvation cannot occur | Good average waiting time, but switching cost rises as the quantum falls |
| Multilevel queue | Depends on each queue | Lower queues can starve if higher queues are always busy | Efficient for mixed workloads, but complex to configure |
| Priority | Either form | Low-priority processes starve unless aging is applied | Efficient for deadline work, but depends on priorities being assigned correctly |