The following differences were identified between the SJF and FCFS scheduling algorithm.
FCFS executes processes based on the order in which they arrive the processor, the process that requests the CPU first is allocated the CPU first while SJF executes the processes based on the order of the time it takes to execute each process with the shortest task first.
In SJF, the duration time of all the tasks needs to be identified in advance while this is not required in FCFS
The average waiting time is higher in FCFS than in SJF because in FCFS, shorter tasks could be made to wait for longer time if they arrive the CPU late, thereby increasing the overall average wait time. In SJF, the shortest tasks are completed before the longer ones, thereby reducing the average wait time.
No comments:
Post a Comment