
선 요약
| FIFO | min Overhead | poor resp
w. vary tasks | optimal resp
w. same tasks |
| --- | --- | --- | --- |
| SJF | | optimal resp | |
| RR | | ~SJF
w. vary tasks | worst policy
w. same tasks |
Process Scheduling
- Process Queue
- collection of state of all processes
- ready-to-run processes (run queue / ready queue)
- blocked processes (wait queue)
- 하나의 이유마다 하나의 큐 존재
ex. IO queue, sleep queue, …
- Scheduler
- Long term: job scheduler
- invoked infrequently (sec~min)
- Short term: CPU Scheduler
- invoked frequently (ms)
- invoked when new ready process is inserted into ready queue
ex. on timer interrupt, IO, …
- then choose order in the queue.
- must be fast
CPU Scheduler
- Select a Process among the processes in ready queue
- then allocate CPU to process
Process States
running: executing
ready: wating for CPU
waiting: wait for lock
Scheduling When?
- running → waiting (thread_block)
- running → ready (thread_yield)
- waiting → ready (thread_unblock)
- exit
Terminology
- Task of Job: everything
- ex. mouse click, web request, shell command, …