Why is non-preemptive SJF optimal for average waiting time?
Total WT weights earliest jobs by largest multiplier (n−i); minimizing means smallest bursts get largest multipliers ⇒ sort ascending ⇒ shortest first.
What is the convoy effect?
In FCFS, one long job at the front forces many short jobs to wait, inflating average waiting time.
SRTF preempts when?
When a newly arrived process has remaining burst smaller than the currently running process's remaining burst.
Round Robin with q → ∞ behaves like?
FCFS (no preemption ever triggers).
Round Robin with q → 0 problem?
Excessive context-switch overhead; CPU does little useful work.
What metric does Round Robin optimize best?
Response time / fairness (no starvation).
What is starvation in Priority scheduling and its fix?
Low-priority jobs never run because higher ones keep arriving; fix is aging (raise priority with waiting time).
Which scheduler gives minimum average waiting time (no preemption)?
SJF (Shortest Job First).
Order of metrics computed from a Gantt chart?
CT first, then TAT = CT−AT, then WT = TAT−BT.
Recall Feynman: explain to a 12-year-old
Imagine one swing and a line of kids. FCFS = whoever lined up first swings until they're bored — unfair if the first kid stays forever. SJF = let kids who only want a quick push go first, so the line shrinks fast. SRTF = even mid-push, if a kid wanting just one tiny push shows up, you let them in instantly. Round Robin = everyone gets exactly 2 minutes, then back of the line — super fair, nobody's left out. Priority = teacher's pets go first, but if you wait long enough you slowly become a pet too (that's "aging"). Each rule answers the same question — who goes next? — differently.
Dekho, CPU ek hi worker hai jo ek time par ek hi kaam (process) kar sakta hai, par line mein bahut saare processes khade hain. Scheduling algorithm bas ye rule hai ki "agla number kiska?". Yahi decide karta hai ki average mein sab kitna wait karenge. Mast baat ye hai ki sirf order badal ke hi average waiting time half ho sakta hai — koi naya hardware nahi chahiye!
FCFS mein jo pehle aaya wo pehle, pura kaam khatam karke hi hatega — par agar bada job aage khada ho to peeche ke chhote jobs phass jaate hain (ye convoy effect hai). SJF bolta hai jo present hain unme se sabse chhota burst wala pehle bhejo — mathematically ye sabse kam average waiting deta hai. SRTF SJF ka preemptive version hai: beech mein bhi agar koi chhota job aa gaya, to running job se CPU cheen lo.
Round Robin sabse fair hai — har process ko ek fixed time quantum (jaise 2 unit) milta hai, phir wapas line ke peeche. Isse response time accha rehta hai aur koi starve nahi hota. Priority mein number ke hisaab se CPU milta hai, par yahan khatra hai starvation ka — low priority wala kabhi chance hi na mile. Iska ilaaj aging hai: jitna zyada wait, utni priority badhao.
Exam ke liye yaad rakho: pehle Gantt chart banao, usse CT nikalo, phir TAT=CT−AT, phir WT=TAT−BT. SJF/SRTF mein hamesha check karo "abhi tak kaun-kaun aa chuka hai" — sirf wahi choose kar sakte ho. Bas yahi 20% concept 80% questions cover kar dega!