When is FCFS better than SJF?


  • 2

    SJF or Shortest Job First is the optimal algorithm for process scheduling but it can be beaten by First come First serve in the following scenarios -

    1. When all processes have equal burst times. In this case unnecessary time will be wasted by SJF sorting algorithm. Hence, it will lead to more overhead.
    2. When all inputs are already sorted in ascending order. This again follows from the complexity of sorting algorithm.
    3. Another possibility could arise when α isn't balanced between τ and t. This will lead to wrong predictions for the next process.

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.