An Algorithm used by the Scheduler

NamePropertyScheduling criterionProsCons
FCFSIntrinsically non-preemptive; could accommodate preemption at time of I/O completion eventsArrival time (intrinsic property)Fair; no starvationHigh variance in response time; convoy effect
SJFIntrinsically non-preemptive; could accommodate preemption at time of new job arrival and/or I/O completion eventsExpected execution time of jobs (intrinsic property)Preference for short jobs; provably optimal for response time; low variance in response timesPotential for starvation; bias against long running computations
PriorityCould be either non-preemptive or preemptivePriority assigned to jobs (extrinsic property)Highly flexible since priority is not an intrinsic property; its assignment to jobs could be chosen commensurate with the needs of the scheduling environmentPotential for starvation (ameliorated by dynamically increasing priority in proportion to waiting time)
SRTFSimilar to SJF but uses preemptionExpected remaining execution time of jobs (intrinsic)Similar to SJFSimilar to SJF
Round robinPreemptive allowing equal share of the processor for all jobsTime quantum (extrinsic)Equal opportunity for all jobsOverhead for context switching among jobs

Preemptive

Algorithm that forcible takes the Processor away from the current scheduled Process in response to an external event (e.g. I/O completion Interrupt, timer interrupt)

Shortest Remaining Time First

Round Robin

Priority

Round Robin

  • Round Robin is a Preemptive Scheduling Algorithm
  • Requires a timer interrupt
  • When a processes starts, it is given a time quantum (time slice) which limits the continuous CPU time it may use
  • When a process is dispatched, the timer is set to interrupt at the end of the remaining time quantum
  • If a processes uses up its remaining time quantum
    • The process is interrupted
    • The scheduler is called to put the process at the end of the ready list
    • The process’ remaining time quantum is reset
  • If an interrupt other that the timer occurs, the process’ remaining time quantum is reduced by the amount of time it has used prior to the interrupt
Link to original

Nonpreemptive

An algorithm that allows the current scheduled process on the CPU to voluntarily reliquish the processor (either by terminating or making an I/O system call)

Intrinsic

First Come First Serve

Shortest Job First

Extrinsic

Priority

Transclude of Linux#linux-scheduler