iku keputusan kernel babagan thread siap sing entuk CPU , lan . Amarga biasane thread sing bisa mlaku luwih akeh tinimbang core, multiplex dheweke, kanthi tujuan nyeimbangake target sing sulaya — , , lan — karo ngindhari .
iku keputusan kernel babagan thread siap sing entuk CPU , lan . Amarga biasane thread sing bisa mlaku luwih akeh tinimbang core, multiplex dheweke, kanthi tujuan nyeimbangake target sing sulaya — , , lan — karo ngindhari .
FCFS (first-come, first-served) → simple, but one long job blocks everyone (convoy effect)
SJF (shortest job first) → optimal avg wait, but needs to know job length; can starve long jobs
Round-robin (RR) → each job a fixed TIME SLICE (quantum), cycle through → fair, good latency
Priority → highest priority first → can STARVE low priority (fix: aging)
MLFQ (multi-level feedback) → several priority queues; jobs that use a full quantum sink,
interactive jobs that yield stay high → approximates SJF without knowing lengths
Round-robin nggambarake tombol inti — quantum:
quantum too SMALL → fair & responsive, but lots of context-switch overhead
quantum too LARGE → less overhead, but degrades toward FCFS (poor responsiveness)
Standar Linux sing wis suwe yaiku CFS (Completely Fair Scheduler): tinimbang irisan tetep, dheweke nglacak virtual runtime (vruntime) saben task lan tansah mlaku thread sing nampa CPU paling sithik nganti saiki, ditimbang miturut nilai nice-ne — nyedhaki "saben wong entuk bagean sing adil." Dheweke nganggo red-black tree kanthi kunci vruntime, mula milih task sabanjure iku O(log n). (Kernel sing luwih anyar nganggo EEVDF, panyempurnaan kanthi target adil sing padha ditambah wates latency sing luwih ketat.)
Preemptive vs cooperative: OS modern iku preemptive — timer interrupt ngidini scheduler ngrebut CPU kanthi peksa, saengga siji thread ora bisa mborong core.
Scheduling langsung mbentuk latency lan throughput sing dirasakake pangganggo. Pewawancara ndhedhes bab iki kanggo ndeleng apa kowe ngerti trade-off — kenapa beban kerja interaktif pengin quantum cendhak utawa boost prioritas, kenapa priority scheduling butuh aging kanggo ngindhari starvation, lan kepiye MLFQ/CFS entuk prilaku interaktif sing apik tanpa ngerti dawane job luwih dhisik. Iki uga model pikir ing mburi nyetel nice, prioritas real-time, lan ndiagnosa service sing keluwen utawa lag.
Pustaka pitakon wawancara IT kanthi jawaban rinci — saka Junior nganti Senior.
Nyumbang