Article Directory
E1.
answer.
- No attention, FCFS and non-preemptive SJF, who can be wrong
- Need to pay attention to each point in time, there may be a process with a shorter execution time preempting the current process, such as 4 s 4s in the figureAt 4 s , the execution time of process B is 5s, and the execution time of process C that just arrived is 4s, so it will preempt
- HRRN-Highest Response Ratio Next, note that it is not preemptive, the time point for calculating the priority is when a process is completed. The priority calculation method is: P = W ait / N eed P=Wait/NeedP=W a i t / N e e d is the ratio of the waiting time to the required service time,PPThe higher the P, the higher the priority
- When there is a new arrival process A and enqueue process B at a certain point in time, A joins the team before B
- When each process is processed for the first time, it will be added to the highest priority queue
- Only when the high priority queue is empty, the low priority queue will be processed, but you need to pay attention to preemption and non-preemption
- No matter which priority the queue is, it will be degraded if it is not completed within a time slice
- In the case of preemption, when a new process arrives in the high priority queue, it will directly preempt the running process in the low priority queue.
- Degradation will not occur if preempted. Degradation only occurs for those processes that have not finished running within a time slice.
standard answer.
The standard answer comes from teacher Zheng Meiguang, Central South University
E2.
- Priority scheduling algorithms are also divided into preemptive/non-preemptive types, which are not very complicated. SJF algorithm can be regarded as a special case of priority scheduling algorithms.