sjf調度算法
In SJF Scheduling, CPU is assigned to the process having the smallest burst time but it can not be implemented practically, because we don't know burst time of the arrived processes in advance.
在SJF Scheduling中 ,將CPU分配給具有最短突發時間的進程,但是由于我們事先不知道到達進程的突發時間,因此它實際上無法實現。
The predicted burst time of the future process may not always be correct because the burst time of a process also depends on the kind of a process.
未來過程的預測突發時間可能并不總是正確的,因為一個過程的突發時間還取決于一個過程的類型。
There are many methods by which we can predict the burst time for the processes,
我們可以通過多種方法來預測過程的爆發時間 ,
Static methods
靜態方法
Dynamic methods
動態方法

1)靜態方法 (1) Static methods)
There are two static factors by we can predict the burst time of processes,
我們可以通過兩個靜態因素來預測進程的爆發時間,
According to process type
根據Craft.io類型
According to process size
根據Craft.io尺寸

i)根據Craft.io類型 (i) According to process type)
In this method, burst time can be predicted according to the type of process,
在這種方法中,可以根據進程類型預測突發時間,
User Process:
用戶流程 :
The Process which is initiated by the users is referred to as user processes. User processes can be of the following types.
由用戶發起的過程稱為用戶過程。 用戶進程可以是以下類型。
Foreground process:
前臺流程 :
The processes which are accessed by the user to perform their needs such as MS office, Editors, utility software, calculators, etc are called foreground processes.
用戶訪問以執行其需求的過程,例如MS Office,編輯器,實用軟件,計算器等,稱為前臺過程。
These types of processes are a perfect mix of CPU and IO bound processes so they have a bit higher burst time.
這些類型的進程是CPU和IO綁定進程的完美結合,因此它們的突發時間要長一些。
Interactive Process:
互動過程 :
The processes which interact with the user at different time intervals or execution of these processes totally depends on the user inputs are called Interactive Processes. Various games have come in the category of interactive processes.
在不同時間間隔與用戶交互的過程或這些過程的執行完全取決于用戶的輸入,稱為交互過程。 各種游戲都屬于交互過程類別。
They don't need a processor for a large amount of time. As a result, the burst time of these processes is low. They are mainly IO bound processes because they mainly depend upon the user's interactivity with the process
他們不需要大量時間的處理器。 結果,這些過程的突發時間很短。 它們主要是受IO約束的流程,因為它們主要取決于用戶與流程的交互性
Background process:
后臺進程 :
Some processes support the execution of other processes are known as background processes. These processes work in hidden mode. Just like, the key logger is the process that records the keys pressed by the user and activities of the user on the system. These processes need CPU for a large amount of time that’s why they are CPU bound processes.
一些支持其他進程執行的進程稱為后臺進程。 這些進程以隱藏模式工作。 就像鍵記錄器一樣,它是記錄用戶按下的鍵和用戶在系統上的活動的過程。 這些進程需要大量的CPU時間,這就是它們是受CPU約束的進程的原因。
Operating System Process:
操作系統流程 :
Operating System Processes can be of different types such as schedulers, compilers, program managers and many more other system processes. Burst time of Operating system process is generally lower approximate 3 to 5 units of time.
操作系統進程可以是不同類型的,例如調度程序,編譯器,程序管理器以及更多其他系統進程。 操作系統進程的突發時間通常較低,大約為3到5個單位時間。
ii)根據Craft.io規模 (ii) According to process size)
In this method, burst time can be predicted according to the size of a process.
在這種方法中,可以根據過程的大小預測突發時間。
Here, the burst time is taken similar to the currently running process and the newly arrived process that is to be executed.
在此,突發時間類似于當前正在運行的進程以及將要執行的新到達進程。
For example, suppose a size currently running process (Pold) is 150 KB and it takes 10 units of time for its execution.
例如,假設當前正在運行的進程(Pold)大小為150 KB,并且執行該進程需要10個時間單位。
So, the burst time for any newly arrived process of size around 150 KB can be taken as 10 units of time.
因此,任何大小約為150 KB的新到達進程的突發時間都可以視為10個時間單位。
References:
參考文獻:
Prediction of CPU Burst Time for a process in SJF
SJF中進程的CPU突發時間的預測
Predicting Burst Time | SJF Scheduling
預測爆發時間 SJF計劃
Shortest job next
接下來最短的工作
翻譯自: https://www.includehelp.com/operating-systems/how-can-be-predict-the-burst-time-of-future-process-in-sjf-scheduling-by-static-method.aspx
sjf調度算法