Resource Allocation

Introduction

OS 可能同時跑著數十個 process,而硬體資源有限,所以 OS 就充當公正的仲裁者決定誰可以在什麼時候拿到什麼資源

Physical vs. Logical Resource

Physical Device

看得見摸得著,像是 disk space、I/O device

Logical Device

像是 CPU cycles、Process ID、User ID

Temporary vs. Permanent Assignment

Temporary Assignment

像是 CPU cycles 和 memory pages,OS 只讓你在一段時間內使用它,過了時間就得還回去讓下一個 process 用

Permanent Assignment

像是 secondary storage,我們建立一個檔案除非自己刪掉,否則這段 disk space 不會被收回去