Basic Concepts
- 멀티프로그래밍을 통해 최대 CPU 활용률을 얻을 수 있다. (time sharing 기반)
- 멀티프로그래밍은 job을 organaze하여 CPU가 항상 돌아가도록 한다.
- CPU Burst 와 I/O Burst를 적절히 분배해야 CPU 효율성이 올라간다.
CPU Scheduler (Algorithm)
1) Switches from running to waiting state (e.g., I/O request)
2) Switches from running to ready state (e.g., interrupt)
3) Switches from waiting to ready (e.g., I/O completion)
4) Terminates
-> Scheduling under 1) and 4) is nonpreemptive : 자신에게 할당된 자원을 사용하다 끝나면 상태 변화
-> Another scheduling 2), 3) is preemptive : interrupt나 I/O 발생 시 즉각 자원 반납하고 상태 변화
- Nonpreemptive : CPU 할당을 해제할 때까지 CPU 자원을 사용한다
- Preemptive : 공유데이터 access와 관련된 비용 발생 / 특정 H/W 플랫폼에서만 사용 가능하다.
Dispatcher : ready status의 process가 CPU에 할당받는 상태로 가게 해 준다.
Dispatch latency : process를 변경하는 동안의 지연시간
Scheduling Criteria (스케쥴링 기준)
- CPU utilization : keep the CPU as busy as possible
- Throughput : 초 당 시행되는 process(job)의 수 (job/sec)
- Turnaround time : 특정 process를 실행하는데 걸리는 시간의 총 량
- Waiting time : ready queue에서 기다리는데 걸리는 시간
- Response time : 하나의 job이 완료되는데 걸리는 시간 (sec/job)
- Maximize : CPU utilization and Throughput
Minimize : Turnaround time, Waiting time, and Response time
- Optimize the minimum and maximum values rather than the average. (min, max 값을 최적화하는 것이 평균값 최적화보다 우선이다)
- Response time의 분산(variance) 줄이기.
Scheduling Algorithms (다음 시간)
- FCFS (First-Come, First-Served) Scheuling
- SJF (Shortest-Job-First) Scheduling
- Priority Scheduling
- RR (Round-Robin) Scheduling
- Multilevel Queue Scheduling
- Multilevel Feedback Queue Scheduling
'운영체제' 카테고리의 다른 글
프로세스(Process)와 스레드(Thread) (0) | 2022.10.13 |
---|---|
[Linux] 리눅스 부팅 과정, 리눅스 런 레벨(Runlevel) (0) | 2022.09.26 |
4 Thread (0) | 2021.04.09 |
3-3 IPC (0) | 2021.04.09 |
3-2 Process Scheduling (0) | 2021.04.05 |