操作系统 系统开销比率_操作系统中的最高响应比率下一个(HRRN)调度
操作系統 系統開銷比率
操作系統中的HRRN調度是什么? (What is HRRN Scheduling in Operating System?)
HRRN is the abbreviation of Highest Response Ratio Next Scheduling. It is an optimal scheduling algorithm.
HRRN是最高響應率下一個調度的縮寫 。 這是一種最佳的調度算法。
It is non-preemptive scheduling algorithm that means if there is any process currently executing with the CPU and if a new process arrives in the memory and its burst time is smaller than the currently running process then currently running process will not be put in the ready queue and it can complete its execution without any interruption.
這是一種非搶占式調度算法,這意味著如果CPU當前正在執行任何進程,并且如果有新進程到達內存,并且其突發時間小于當前正在運行的進程,那么當前正在運行的進程將不會處于就緒狀態隊列,它可以完成其執行而不會受到任何干擾。
Non-preemptive scheduling algorithms are designed so that once a process starts its execution, it cannot be preempted until it completes its allotted time.
非搶占式調度算法的設計宗旨是,一旦一個進程開始執行,就無法搶占該進程,直到它完成其分配的時間。
It is the modification of shortest job next (SJN) to mitigate the problem of process starvation.
這是最短作業下一個(SJN)的修改,以減輕過程不足的問題。
In this scheduling algorithm assign the CPU to the next process which has the highest response ratio not according to the shortest burst time.
在此調度算法中,不根據最短的突發時間將CPU分配給響應率最高的下一個進程。
算法 (Algorithm)
This scheduling is done based on the response ratio. Response ratio can be calculated with arrival time, waiting time and CPU burst time.
該調度是基于響應率來完成的。 響應率可以通過到達時間,等待時間和CPU突發時間來計算。
Response Ratio = (W+S)/S Where, W= waiting timeS= Burst timeIn this scheduling, once a process selected for execution then it will run until its completion.
在此調度中,一旦選擇要執行的進程,它將一直運行到完成為止。
First, we have to calculate the waiting time for all the processes. The sum of the periods spent waiting in the ready queue is referred to as waiting time.
首先,我們必須計算所有流程的等待時間。 在就緒隊列中等待所花費的時間之和稱為等待時間。
Each time processes get scheduled for execution to find response ratio for each available process.
每次安排執行進程的時間,以查找每個可用進程的響應率。
Process having shortest response ratio will be executed first by the processor.
響應率最短的處理將首先由處理器執行。
If two processes have the same response ratio then break the tie using the FCFS scheduling algorithm.
如果兩個進程的響應率相同,則使用FCFS調度算法打破平局。
Example:
例:
Here is an example of HRRN Scheduling given arrival time and burst or service time of each process,
這是給定每個進程的到達時間和突發或服務時間的HRRN調度示例 ,
Solution:
解:
Explanation:
說明:
At time t = 0, only the process P0 is available in the ready queue. So, process P0 executes till its completion.
在時間t = 0時,就緒隊列中只有進程P0可用。 因此,過程P0一直執行到完成為止。
At time t = 4, only the process P1 and P2 are available in the ready queue. So, we have to calculate the response ratio.
在時間t = 4時,就緒隊列中僅進程P1和P2可用。 因此,我們必須計算響應率。
The process which has the highest response ratio will be executed next.
接下來將執行響應率最高的過程。
Response Ratio are,
回應率是
RR (P1) = [(4 - 3) + 3] / 3 = 1.40RR (P2) = [(4 - 3) + 3] / 3 = 0.75Process P1 has highest response ratio so it will selected for execution.
進程P1的響應率最高,因此將選擇執行。
After the completion of execution of process P1, there are three processes P2, P3 and P4 are in the ready queue.
在完成過程P1的執行之后,就緒隊列中有三個過程P2,P3和P4。
So, the Response Ratio for processes P2, P3 and P4 are,
因此,過程P2,P3和P4的響應率是
RR (P2) = [(9 - 4) + 3] / 3 = 2.66RR (P3) = [(9 - 6) + 6] / 6 = 1.50RR (P4) = [(9 - 8) + 3] / 3 = 1.33Process P2 has highest response ratio so it will selected for execution.
進程P2的響應率最高,因此將選擇執行。
After the completion of execution of process P2, there are three processes P3 and P4 are in the ready queue.
在完成過程P2的執行之后,在準備隊列中有三個過程P3和P4。
So, the Response Ratio for processes P3 and P4 are,
因此,過程P3和P4的響應率是
RR (P3) = [(12 - 6) + 6] / 6 = 2RR (P4) = [(12 - 8) + 3] / 3 = 2.33Process P4 has highest response ratio so it will be executed next.
進程P4的響應率最高,因此將在下一步執行。
After the completion of the execution of process P4, there are only process P3 in the ready queue. So, it will be executed next.
在完成過程P4的執行之后,就緒隊列中只有過程P3。 因此,將在下一個執行。
Advantages
優點
Its performance is better than SJF Scheduling.
它的性能優于SJF計劃 。
It limits the waiting time of longer jobs and also supports shorter jobs.
它限制了較長工作的等待時間,也支持較短的工作。
Disadvantages
缺點
It can't be implemented practically.
它實際上無法實現。
This is because the burst time of all the processes can not be known in advance.
這是因為無法預先知道所有進程的突發時間。
翻譯自: https://www.includehelp.com/operating-systems/highest-response-ratio-next-hrrn-scheduling.aspx
操作系統 系統開銷比率
總結
以上是生活随笔為你收集整理的操作系统 系统开销比率_操作系统中的最高响应比率下一个(HRRN)调度的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云米冰箱复位键在哪里
- 下一篇: ai系统架构_人工智能中的模糊逻辑系统架