- Processes alternate CPU bursts and I/O bursts; most CPU bursts are short.
- Scheduling decisions when a process: 1) running → waiting, 2) running → ready, 3) waiting → ready, 4) terminates. Only 1 and 4 → nonpreemptive; otherwise preemptive.
🎯 How this can come up · 1 question
Under nonpreemptive scheduling, the CPU is taken from a process only when it:
Correct: Terminates or switches to waiting.
- Dispatcher gives the CPU to the chosen process: context switch, switch to user mode, jump to the right instruction. Dispatch latency = time to do this.
- Maximize CPU utilization and throughput; minimize turnaround, waiting and response time.
🎯 How this can come up · 1 question
Which criterion should be MINIMIZED?
Correct: Waiting time.
- FCFS: run in arrival order; nonpreemptive. Convoy effect: short processes wait behind a long one.
🎯 How this can come up · 1 question
P1 = 24, P2 = 3, P3 = 3 arrive in that order at time 0. FCFS average waiting time:
(0 + 24 + 27) / 3.
- Order P2, P3, P1 gives average wait (6 + 0 + 3) / 3 = 3: order matters a lot.
- SJF: run the shortest next CPU burst. Optimal: minimum average waiting time for a given set. Problem: you can’t know the next burst length.
🎯 How this can come up · 1 question
SJF gives the minimum average waiting time for a given set of processes.
True.
- Predict the next burst: τₙ₊₁ = α·tₙ + (1 − α)·τₙ (exponential averaging), usually α = ½.
🎯 How this can come up · 1 question
τ₀ = 10, α = 0.5, the actual burst t₀ = 6. τ₁ =
0.5·6 + 0.5·10.
- SRTF = preemptive SJF: a new arrival with a shorter burst than the remaining time preempts the running process.
- Round Robin: each process gets a time quantum q, then goes to the back of the ready queue. No process waits more than (n − 1)q.
🎯 How this can come up · 1 question
P1 = 24, P2 = 3, P3 = 3, RR with q = 4. P1 completes at time:
P1 runs 0–4, P2 4–7, P3 7–10, then P1 alone until 30.
- Large q → behaves like FCFS. Small q → too many context switches. q should be large compared with the context-switch time (80% of bursts < q).
🎯 How this can come up · 1 question
If the RR time quantum is very large, RR behaves like:
Correct: FCFS.
- Priority scheduling (smaller number = higher priority here). Problem: starvation. Solution: aging (raise priority over time).
🎯 How this can come up · 1 question
The solution to starvation in priority scheduling is:
Correct: Aging.
- Multilevel queue: separate queues (e.g. foreground RR, background FCFS), each with its own algorithm; scheduling between queues by fixed priority or time slices.
- Multilevel feedback queue: processes MOVE between queues (demote CPU-hogs, age old ones up).
🎯 How this can come up · 1 question
What distinguishes a multilevel FEEDBACK queue from a multilevel queue?
Correct: Processes can move between queues.
- Process-contention scope (user threads on LWPs) vs. system-contention scope (kernel threads competing system-wide).
- Rate-monotonic: static priority = shorter period gets higher priority.
- Deterministic modelling: compute each algorithm’s numbers for a given workload.
No slides match this filter.












































