api: YAML JSON TOON Database version: 1.0.0 format: json dataset: slug: cpu-scheduling-algorithms title: CPU Scheduling Algorithms description: Algorithms used by the OS to allocate CPU time. summary: "The classic CPU scheduling algorithms, each marked preemptive or non-preemptive with a one-line description, from first-come first-served to multilevel feedback queues, plus real-time schedulers such as earliest-deadline-first and the Linux Completely Fair Scheduler." use_when[2]: "You need to compare scheduling policies by fairness, responsiveness and starvation risk.",You are explaining how an OS divides CPU time among processes. caveats[2]: Textbook algorithms assume known burst times; real systems estimate them or ignore them.,"Real schedulers combine ideas, for example priority queues with time slices and aging to avoid starvation." related[3]: process-management,deadlock-handling,memory-management category: Operating Systems category_slug: operating-systems tags: "os,scheduling,cpu" view_count: 0 entry_count: 13 fields[3]{section,field,type,example}: data,name,string,First-Come First-Served data,type,string,Non-preemptive data,description,string,Processes run in arrival order; simple but can … data[13]{name,type,description}: First-Come First-Served,Non-preemptive,Processes run in arrival order; simple but can cause convoy effect. Shortest Job First,Non-preemptive,Runs the process with the shortest estimated burst time. Shortest Remaining Time First,Preemptive,Preemptive version of SJF. Round Robin,Preemptive,Each process gets a fixed time quantum in cyclic order. Priority Scheduling,Variable,Highest priority process runs first. Multilevel Queue,Non-preemptive queues,Processes assigned to fixed priority queues. Multilevel Feedback Queue,Adaptive,Processes move between queues based on behavior and aging. Highest Response Ratio Next,Non-preemptive,"Picks the ready process with the highest (waiting time + service time) / service time, which prevents starvation of long jobs." Earliest Deadline First,Preemptive,Real-time policy that always runs the task with the nearest deadline; optimal on a single processor when utilization is at most 100%. Rate-Monotonic Scheduling,Preemptive,Fixed-priority real-time policy that gives shorter-period tasks higher priority. Completely Fair Scheduler,Preemptive,"Linux's general-purpose scheduler for many years, tracking each task's virtual runtime in a red-black tree to share CPU time fairly." Lottery Scheduling,Preemptive,"Randomly selects the next process in proportion to the tickets it holds, giving probabilistic proportional share." Fair-Share Scheduling,Preemptive,Divides CPU time among users or groups rather than individual processes.