优先级调度算法动态优先级_与优先级调度有关的问题及其解决方案
優(yōu)先級(jí)調(diào)度算法動(dòng)態(tài)優(yōu)先級(jí)
We are already familiar with what Priority Scheduling is. It is one of the most used process scheduling algorithm used in operating systems, in which every process is assigned with a priority. According to this algorithm, the process with the highest priority is set to be provided the CPU first or simply is to be executed first.
我們已經(jīng)熟悉什么是優(yōu)先調(diào)度。 它是操作系統(tǒng)中使用最廣泛的進(jìn)程調(diào)度算法之一,在該算法中,每個(gè)進(jìn)程都分配了優(yōu)先級(jí)。 根據(jù)該算法,將優(yōu)先級(jí)最高的過(guò)程設(shè)置為首先提供給CPU或簡(jiǎn)單地首先執(zhí)行。
In priority scheduling algorithm, a major problem to be considered is the starvation of a process i.e. a process which is ready to be executed but is waiting for the CPU because of its low priority. This can lead to the indefinite waiting of the low-priority processes. A continuous flow of higher priority processes to the O.S can prevent a low priority process from ever getting the CPU.
在優(yōu)先級(jí)調(diào)度算法中 ,要考慮的主要問(wèn)題是進(jìn)程的饑餓 ,即由于其低優(yōu)先級(jí)而準(zhǔn)備執(zhí)行但正在等待CPU的進(jìn)程。 這可能導(dǎo)致無(wú)限期等待低優(yōu)先級(jí)進(jìn)程。 高優(yōu)先級(jí)進(jìn)程不斷流向OS可以防止低優(yōu)先級(jí)進(jìn)程獲得CPU。
Let's take an example to understand what starvation is. Suppose there are 100 processes in which a process 'X' has the lowest priority because of which it will be executed at last. Let say before the process 'X' is provided CPU for the execution some more processes are provided to the operating system having a priority higher than that of process 'X'. Now what will happen is, the process 'X' won't get the chance to get executed no matter what was its arrival time. It is possible that, as the time passes by the O.S is given more processes having higher priority than that of 'X', due to which 'X' can wait indefinitely or could never be executed. This Problem is known as 'Starvation'.
讓我們舉一個(gè)例子來(lái)了解什么是饑餓 。 假設(shè)有100個(gè)進(jìn)程,其中進(jìn)程'X'具有最低優(yōu)先級(jí),因?yàn)樗罱K將被執(zhí)行。 可以說(shuō),在為CPU提供進(jìn)程“ X”以供執(zhí)行之前,向操作系統(tǒng)提供的其他進(jìn)程的優(yōu)先級(jí)高于進(jìn)程“ X”的優(yōu)先級(jí)。 現(xiàn)在將要發(fā)生的是,無(wú)論到達(dá)時(shí)間是什么,進(jìn)程“ X”都不會(huì)有執(zhí)行的機(jī)會(huì)。 隨著時(shí)間的流逝,可能會(huì)給OS提供更多比'X'具有更高優(yōu)先級(jí)的進(jìn)程,因此'X'可以無(wú)限期等待或無(wú)法執(zhí)行。 這個(gè)問(wèn)題被稱為“饑餓” 。
For solving the problem of starvation we have the concept of Aging. In aging what we do is increasing the priority of those process that has been waiting long because of low priority after some specified amount of time. Due to which after the specified time its priority is increased and could be provided with the CPU for the execution.
為了解決饑餓問(wèn)題,我們有老齡化的概念。 在老化中,我們要增加由于在指定的時(shí)間量后優(yōu)先級(jí)較低而一直等待很久的那些進(jìn)程的優(yōu)先級(jí)。 因此,在指定的時(shí)間之后,其優(yōu)先級(jí)會(huì)增加,并且可以隨CPU提供以執(zhí)行該優(yōu)先級(jí)。
翻譯自: https://www.includehelp.com/operating-systems/problem-associated-with-priority-scheduling-and-its-solution.aspx
優(yōu)先級(jí)調(diào)度算法動(dòng)態(tài)優(yōu)先級(jí)
總結(jié)
以上是生活随笔為你收集整理的优先级调度算法动态优先级_与优先级调度有关的问题及其解决方案的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 软件工程质量管理体系要求_软件质量管理|
- 下一篇: ruby array_在Ruby中使用A