Scheduling Algorithms

  1. Shortest-Job-First (SJF) Scheduling.
    • In this algorithm, when several processes arrive at the same time, processes with shorter burst times will run first.
    • SJF could be either cooperative or preemptive. When the preemptive version of SJF is used, a process will be removed from the CPU when another process with a shorter burst time arrives at the ready queue.
    • Advantage: It will maximize the throughput and minimize the average waiting time.
    • Disadvantage: We don't know what the future burst time of a process will be.
    • To address this, we could do either of the following:
      1. Ask the user to indicate how long they want the process to run.
      2. Gather statistics on how long the burst time of a process of a certain type is.
      3. [Best approach:] Predict the length of the next burst, based on some historical measurement of recent burst times for this process.