操作系统 系统开销比率_操作系统中的最高响应比率下一个(HRRN)调度
操作系統(tǒng) 系統(tǒng)開銷比率
操作系統(tǒng)中的HRRN調(diào)度是什么? (What is HRRN Scheduling in Operating System?)
HRRN is the abbreviation of Highest Response Ratio Next Scheduling. It is an optimal scheduling algorithm.
HRRN是最高響應(yīng)率下一個調(diào)度的縮寫 。 這是一種最佳的調(diào)度算法。
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.
這是一種非搶占式調(diào)度算法,這意味著如果CPU當(dāng)前正在執(zhí)行任何進(jìn)程,并且如果有新進(jìn)程到達(dá)內(nèi)存,并且其突發(fā)時間小于當(dāng)前正在運(yùn)行的進(jìn)程,那么當(dāng)前正在運(yùn)行的進(jìn)程將不會處于就緒狀態(tài)隊(duì)列,它可以完成其執(zhí)行而不會受到任何干擾。
Non-preemptive scheduling algorithms are designed so that once a process starts its execution, it cannot be preempted until it completes its allotted time.
非搶占式調(diào)度算法的設(shè)計(jì)宗旨是,一旦一個進(jìn)程開始執(zhí)行,就無法搶占該進(jìn)程,直到它完成其分配的時間。
It is the modification of shortest job next (SJN) to mitigate the problem of process starvation.
這是最短作業(yè)下一個(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.
在此調(diào)度算法中,不根據(jù)最短的突發(fā)時間將CPU分配給響應(yīng)率最高的下一個進(jìn)程。
算法 (Algorithm)
This scheduling is done based on the response ratio. Response ratio can be calculated with arrival time, waiting time and CPU burst time.
該調(diào)度是基于響應(yīng)率來完成的。 響應(yīng)率可以通過到達(dá)時間,等待時間和CPU突發(fā)時間來計(jì)算。
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.
在此調(diào)度中,一旦選擇要執(zhí)行的進(jìn)程,它將一直運(yùn)行到完成為止。
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.
首先,我們必須計(jì)算所有流程的等待時間。 在就緒隊(duì)列中等待所花費(fèi)的時間之和稱為等待時間。
Each time processes get scheduled for execution to find response ratio for each available process.
每次安排執(zhí)行進(jìn)程的時間,以查找每個可用進(jìn)程的響應(yīng)率。
Process having shortest response ratio will be executed first by the processor.
響應(yīng)率最短的處理將首先由處理器執(zhí)行。
If two processes have the same response ratio then break the tie using the FCFS scheduling algorithm.
如果兩個進(jìn)程的響應(yīng)率相同,則使用FCFS調(diào)度算法打破平局。
Example:
例:
Here is an example of HRRN Scheduling given arrival time and burst or service time of each process,
這是給定每個進(jìn)程的到達(dá)時間和突發(fā)或服務(wù)時間的HRRN調(diào)度示例 ,
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時,就緒隊(duì)列中只有進(jìn)程P0可用。 因此,過程P0一直執(zhí)行到完成為止。
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時,就緒隊(duì)列中僅進(jìn)程P1和P2可用。 因此,我們必須計(jì)算響應(yīng)率。
The process which has the highest response ratio will be executed next.
接下來將執(zhí)行響應(yīng)率最高的過程。
Response Ratio are,
回應(yīng)率是
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.
進(jìn)程P1的響應(yīng)率最高,因此將選擇執(zhí)行。
After the completion of execution of process P1, there are three processes P2, P3 and P4 are in the ready queue.
在完成過程P1的執(zhí)行之后,就緒隊(duì)列中有三個過程P2,P3和P4。
So, the Response Ratio for processes P2, P3 and P4 are,
因此,過程P2,P3和P4的響應(yīng)率是
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.
進(jìn)程P2的響應(yīng)率最高,因此將選擇執(zhí)行。
After the completion of execution of process P2, there are three processes P3 and P4 are in the ready queue.
在完成過程P2的執(zhí)行之后,在準(zhǔn)備隊(duì)列中有三個過程P3和P4。
So, the Response Ratio for processes P3 and P4 are,
因此,過程P3和P4的響應(yīng)率是
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.
進(jìn)程P4的響應(yīng)率最高,因此將在下一步執(zhí)行。
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的執(zhí)行之后,就緒隊(duì)列中只有過程P3。 因此,將在下一個執(zhí)行。
Advantages
優(yōu)點(diǎn)
Its performance is better than SJF Scheduling.
它的性能優(yōu)于SJF計(jì)劃 。
It limits the waiting time of longer jobs and also supports shorter jobs.
它限制了較長工作的等待時間,也支持較短的工作。
Disadvantages
缺點(diǎn)
It can't be implemented practically.
它實(shí)際上無法實(shí)現(xiàn)。
This is because the burst time of all the processes can not be known in advance.
這是因?yàn)闊o法預(yù)先知道所有進(jìn)程的突發(fā)時間。
翻譯自: https://www.includehelp.com/operating-systems/highest-response-ratio-next-hrrn-scheduling.aspx
操作系統(tǒng) 系統(tǒng)開銷比率
總結(jié)
以上是生活随笔為你收集整理的操作系统 系统开销比率_操作系统中的最高响应比率下一个(HRRN)调度的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云米冰箱复位键在哪里
- 下一篇: 地下城与勇士 大将军 如何 加点