Scheduling Algorithm Evaluation
Choosing the right scheduling algorithm
Algorithm Evaluation 的第一個步驟是先知道自己的需求,像是你的需求專注在 CPU scheduling criteria 中的哪些標準
Some Evaluation Methods
1. Deterministic Evaluation
D-OS-Ch05ja-Deterministic_Evaluation
2. Queueing Model
3. Simulations
用程式將整個電腦系統模擬出來,用資料結構來代表 CPU、ready queue、I/O device,用變數代表 clock。然後讓這個模擬系統跑起來觀察各種指標
Problem
就算是 simulation 也只是誤差很小的模擬,真正的 computer system 會因為真實環境有不同的表現,所以最準確的方式其實就是到真實環境實際跑跑看
然而,此法不只成本高,而且硬體不同的機器也會跑出不同的數據,我們也不可能真正去測一個 scheduling algorithm 在任意硬體組合的表現
因此,現代 OS 選擇讓 scheduler 可以有足夠的彈性(像是能調 priority 之類的)讓使用者可以根據自己需求與環境調整 scheduler,也就是不改 scheduling algorithm 了。