CPU IO CPU CPU Scheduling CPU IO Page

  • Slides: 55
Download presentation

CPU & I/O 버스트 교환 순서 CPU 스케줄링(CPU Scheduling) CPU 버스트 시간 I/O 버스트

CPU & I/O 버스트 교환 순서 CPU 스케줄링(CPU Scheduling) CPU 버스트 시간 I/O 버스트 시간 Page 9 Operating Systems by Yang-Sae Moon

문맥 전환(Context Switch) – 제 3장 CPU 스케줄링(CPU Scheduling) dispatcher latency Page 14 Operating

문맥 전환(Context Switch) – 제 3장 CPU 스케줄링(CPU Scheduling) dispatcher latency Page 14 Operating Systems by Yang-Sae Moon

최적화 기준(Optimization Criteria) CPU 스케줄링(CPU Scheduling) 최대화가 바람직한 기준 • CPU 사용률(CPU utilization) •

최적화 기준(Optimization Criteria) CPU 스케줄링(CPU Scheduling) 최대화가 바람직한 기준 • CPU 사용률(CPU utilization) • 처리량(throughput) 최소화가 바람직한 기준 • 총처리 시간(turnaround time) • 대기 시간(waiting time) • 응답/반응 시간(response time) Page 18 Operating Systems by Yang-Sae Moon

FCFS 스케줄링 예제 – 참조 0 P 1 P 2 10 20 30 I/O

FCFS 스케줄링 예제 – 참조 0 P 1 P 2 10 20 30 I/O (20) CPU (10) CPU(6) CPU(4) 10 CPU (4) I/O(24) 14 P 1 CPU(6) 50 CPU(9) I/O(17) P 2 CPU(4) 40 CPU(11) I/O(4) CPU (4) P 0 CPU(10) CPU 스케줄링(CPU Scheduling) P 2 CPU(4) 20 I/O(6) 24 30 Page 24 P 2 CPU(4) P 1 CPU(9) P 0 CPU(11) 41 50 54 Operating Systems by Yang-Sae Moon

선점 SJF 스케줄링 예제 – 참조 0 P 1 P 2 10 20 CPU(6)

선점 SJF 스케줄링 예제 – 참조 0 P 1 P 2 10 20 CPU(6) CPU(4) P 0 P 2 CPU(1)CPU(4) 50 CPU(9) I/O(17) P 2 CPU(4) 40 CPU(11) I/O(4) CPU (4) P 1 CPU(6) 30 I/O (20) CPU (10) CPU 스케줄링(CPU Scheduling) CPU (4) I/O(24) P 0 CPU(9) I/O(4) Page 29 P 1 CPU(9) I/O(2) P 2 CPU(4) I/O(1) P 0 CPU(11) Operating Systems by Yang-Sae Moon

비선점 SJF 스케줄링 예제 – 참조 0 P 1 P 2 10 20 CPU(6)

비선점 SJF 스케줄링 예제 – 참조 0 P 1 P 2 10 20 CPU(6) CPU(4) P 2 CPU(4) 50 CPU(9) CPU (4) I/O(24) P 1 CPU(6) 40 CPU(11) I/O(17) I/O(4) CPU (4) P 0 CPU(10) 30 I/O (20) CPU (10) CPU 스케줄링(CPU Scheduling) P 2 CPU(4) Idle (6) Page 30 P 0 CPU(11) P 1 CPU(9) P 2 CPU(4) Operating Systems by Yang-Sae Moon

다음 CPU 버스트 길이 예측 CPU 스케줄링(CPU Scheduling) 이 예제에서, 0 = 10, =

다음 CPU 버스트 길이 예측 CPU 스케줄링(CPU Scheduling) 이 예제에서, 0 = 10, = ½ 1 = x t 0 + (1 – ) x 0 = ½ x 6 + ½ x 10 = 8 2 = x t 1 + (1 – ) x 1 = ½ x 4 + ½ x 8 = 6 Page 32 Operating Systems by Yang-Sae Moon

다단계 큐 스케줄링(Multilevel Queue Scheduling) CPU 스케줄링(CPU Scheduling) (2/2) 다섯 개 큐로 구성된 사례

다단계 큐 스케줄링(Multilevel Queue Scheduling) CPU 스케줄링(CPU Scheduling) (2/2) 다섯 개 큐로 구성된 사례 Page 42 Operating Systems by Yang-Sae Moon

Pthread 스케줄링 CPU 스케줄링(CPU Scheduling) 스레드 생성 시, PCS 혹은 SCS를 지정하는 API를 제공한다.

Pthread 스케줄링 CPU 스케줄링(CPU Scheduling) 스레드 생성 시, PCS 혹은 SCS를 지정하는 API를 제공한다. • PTHREAD_SCOPE_PROCESS는 PCS 스케줄링을 사용하여 스레드들을 스케줄한다. • PTHREAD_SCOPE_SYSTEM은 SCS 스케줄링을 사용하여 스레드들을 스케줄한다. API 호출 예제 /* set the scheduling algorithm to PROCESS or SYSTEM */ pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); Page 47 Operating Systems by Yang-Sae Moon