Dispatcher
把CPU的控制權授予要執行的process
功能有
- 轉換process data
 
- 轉換到使用者模式
 
- 跳到程式呼叫的的地方, 重新開始執行程式。
 
Dispatcher盡可能高速運作,縮短process waiting time,
降低dispatch latency.
Purpose
- 提高單位時間內的process完成數量(Throughput)
 
- 將額外工作(overhead)減至最少。
 
- 平衡資源使用
 
- 提高CPU的使用率
 
- 降低process的turnaround time 
Waiting time = Waiting to get memory + Waiting in ready queue
Execution time = CPU time I/O Doing time. 
Turnaround time = Waiting Time + Execution Time.
 
- 降低response time
 
- 避免發生Starvation
 
- 提供優先處理的制度(Priority)
 
CPU Scheduling Criteria
- cpu utilization
盡可能保持忙綠
期望負載:40%~90%
 
- Throughput
單位時間內所完成的process數目。
 
- Turnaround Time
自process進入system 到process完成工作的時間。
turnaround time 包含1. 等待進入記憶體, 2. 等待進入ready queue
, 3. 在CPU上執行, 以及進行I/O運作等
 
- Waiting Time
process在ready queue中的waiting time.
 
- Response time
從某個process要求delivery直到cpu回應這個process所等待的時間,
 
summary:
盡量
提高cpu利用率
最大thoughput
縮小 turnaround time
縮小 response time
縮小 waiting time