Basic Concepts
Scheduling Criteria(調度標准)
CPU利用率(CPU utilization) --keep the CPU as busy as possible
吞吐率(Theoughput) --of the process that complete their execution per time unit
是指一個時間單元內所完成的進程的數量。
(長進程可能為1h一個進程,短進程可能為1s10個進程)
周轉時間(Turnaround time) --amount of time to execute a particular processs
從進程提交到進程完成的時間為周轉時間
為所有時間段之和(包括等待進入內存,在就緒隊列中等待,在CPU上執行和IO執行)
等待時間(Waiting time) --amount of time a process has been waiting in the ready queue
CPU調度算法並不影響進程運行和執行IO的時間;它只影響進程在就緒隊列中花費的時間
等待時間為在就緒隊列中等待所花費的時間之和。
響應時間(Response time) --amount of time it takes from when a request was submitted until the first response is produced, not output
響應時間時開始響應需要的時間。
我們在設計的時候:
Max CPU utilization
Max throughput
Min turnaround time
Min waiting time
Min response time
Scheduling Algorithms
FCFS 先來先服務
使用FIFO隊列簡單實現:先請求CPU的先分配到CPU
SJF 短作業優先
Priority Scheduling 優先級
Round Robin 時間片輪轉
Multilevel Queue 多級隊列
Multilevel Feedback Queue 多級反饋隊列
Algorithm Evaluation