FUNCTIONAL PRINCIPLES : it's applicable to both job scheduling and process scheduling. 1> SPF(Shortest Process First) : it's non-preemptive . During each process scheduling event, the system selects the process which holds the shortest Estimated CPU Burst Time according to all of processes' estimated CPU burst time in the ready queue. When it turns to job scheduling, it's claimed as Shortest Job First(SJF); The system selects the job which holds the shortest estimated remaining CPU burst time, scheduling processes according to all of jobs' execution time in the Secondary Storage Queue. 2> SRT(Shortest Remaining Time) : It's preemptive . The system selects the process which holds the shortest remaining run time to execute; If within current process's function duration a process that needs shorter time appears in the ready queue, then this process which needs shorter time preempts processor resource, and current process turns its state from the running state to the ready state.
APPLICABLE SCENARIOS : it's suitable to Batch Processing Systems, especially when short jobs are major.
ADVANTAGES : 1> SPF(Shortest Process First) : it's better than FCFS in terms of performance. If scheduling conditions contain "All processes ready for scheduling simultaneously" or "All processes arrive at nearly the same time", the SPF's average waiting time and average turnaround time are optimal 。 2> SRT(Shortest Remaining Time) : further optimizes the average waiting time.
DISADVANTAGES : 1> SPF(Shortest Process First) : Long jobs may end up with "Starvation"; Algorithm needs processes to estimate their function time, but there may be some of issues emerging, for instance, the given time can be inaccurate or fake; Like FCFS, it does not consider the differential among different processes. 2> SRT(Shortest Remaining Time) : It needs to calculate remaining time frequently so its cost is relatively high.
【第二版翻译:(润色后,雅思水准)】
Shortest Process First (SPF and SRT) :
FUNCTIONAL PRINCIPLES : This algorithm is applicable to both job scheduling and process scheduling. 1> SPF(Shortest Process First) : This is a non-preemptive algorithm. During each process scheduling event, the system selects the process with the shortest Estimated CPU Burst Time from the ready queue. When applied to job scheduling, it is known as Shortest Job First(SJF). In this context, the system selects the job with the shortest estimated remaining execution time, scheduling jobs according to all of jobs' execution time in the Secondary Storage Queue. 2> SRT(Shortest Remaining Time) : It is preemptive . The system selects the process with the shortest remaining run time to execute; If, during the current process's execution, a new process requiring a shorter remaining time appears in the ready queue, then this new process preempts the processor resource, and the current process transitions from the running state to the ready state.
APPLICABLE SCENARIOS : It is suitable for Batch Processing Systems, especially in scenarios where short jobs are prevalent.
ADVANTAGES : 1> SPF(Shortest Process First) : It generally offers better performance than FCFS. If scheduling conditions involve "All processes ready for scheduling simultaneously" or "All processes arriving at nearly the same time", the SPF yields optimal average waiting time and average turnaround time 。 2> SRT(Shortest Remaining Time) : It further optimizes the average waiting time.
DISADVANTAGES : 1> SPF(Shortest Process First) : Long jobs may experience "Starvation"; The algorithm requires processes to estimate their execution time, but issues may arise during estimation, such as inaccurate or fabricated time values; Like FCFS, it does not consider the variation among different processes. 2> SRT(Shortest Remaining Time) : It requires frequent calculation of remaining time, leading to relatively high overhead.