Context Switch
cpu控制權從一個process到另一個process的過程。
Consume time of context switch取決於硬體機器
ex.
記憶體速度, 暫存器數量, 以及特殊指令是否存在。
如何降低context-switching負擔
- Architecture的一些特殊指令
 
- Multiple Register Sets
一個process用一個register set, 新的就用另一個,
當要context switching時, o.s.只要轉換指標就行了。
 - 針對o.s.的system process提供private set of registers
 
- 建立LWP(Lightweight Process),即Thread,
來處理Short-Term Job, 這些process有較簡化的PCB及limited context,
以達到partically context switching的目標。