【OS】Process Scheduling Algorithm

E1.

Insert picture description here

answer.

Insert picture description here

  • No attention, FCFS and non-preemptive SJF, who can be wrong

Insert picture description here

  • 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

Insert picture description here

  • 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

Insert picture description here

  • When there is a new arrival process A and enqueue process B at a certain point in time, A joins the team before B

Insert picture description here

  • 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

Insert picture description here

  • 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.

Insert picture description here
Insert picture description here
Insert picture description here

The standard answer comes from teacher Zheng Meiguang, Central South University

E2.

Insert picture description here

  • 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.

About the multi-level feedback queue MFQ.

【Grand Summoning】

Guess you like

Origin blog.csdn.net/weixin_44246009/article/details/106353987