Terminologies o CPU burst vs IO burst 4
Terminologies o CPU burst vs. I/O burst 4 Process execution consists of a cycle of CPU execution and I/O wait 4 CPU burst ë Each cycle of CPU execution 4 I/O burst ë Each cycle of I/O wait CPU burst I/O burst CPU burst 4 Burst time is an important factor(criteria) for scheduling algorithms 컴퓨터공학과 운영체제 I/O burst CPU burst Page 6
– a CPU-bound process – an I/O bound process 컴퓨터공학과 운영체제 Page 8
프로세스 스케줄링의 단계 Short-term scheduling dispatch (schedule) running timerrunout (preemption) ready created Long-term scheduling swap-out (suspend) wakeup sleep (block) asleep swap-in (resume) suspended ready terminate d exit swap-out (suspend) wakeup suspended blocked 컴퓨터공학과 운영체제 Medium-term scheduling Page 11
FIFO 스케줄링 개념 completion P 4 P 3 P 2 P 1 Processor 컴퓨터공학과 운영체제 Page 15
FIFO 스케줄링의 예 P 1 P 2 Process ID Arrival time P 1 P 2 P 3 P 4 P 5 0 1 3 5 6 P 3 P 4 P 5 P 1 0 1 2 P 2 3 P 1 Service time (Processing time) 3 7 2 5 3 4 5 6 7 P 3 8 9 P 4 P 5 10 11 12 13 14 15 16 17 18 19 20 P 2 P 3 컴퓨터공학과 운영체제 P 4 P 5 Page 16
RR 스케줄링 개념 completion P 4 P 3 P 2 P 1 Processor timerrunout 컴퓨터공학과 운영체제 Page 18
RR 스케줄링의 예 P 1 P 2 P 3 P 1 P 2 0 1 2 3 Process ID Arrival time P 1 P 2 P 3 P 4 P 5 0 1 3 5 6 Service time (Processing time) 3 7 2 5 3 P 4 P 5 P 1 4 P 3 5 P 1 6 P 2 7 8 P 4 9 10 P 5 11 12 P 2 13 14 P 3 컴퓨터공학과 운영체제 P 4 P 5 P 2 P 4 15 16 17 18 19 20 P 5 P 2 P 4 Page 19
SPN 스케줄링의 예 P 1 P 2 1 Arrival time P 1 P 2 P 3 P 4 P 5 0 1 3 5 6 P 3 P 1 0 Process ID 2 P 4 P 5 P 3 3 P 1 Service time (Processing time) 3 7 2 5 3 4 P 4 5 P 3 6 7 8 P 5 9 P 2 10 11 12 13 14 15 16 17 18 19 20 P 4 P 5 컴퓨터공학과 운영체제 P 2 Page 22
Process Arrival Time Burst Time P 1 0. 0 7 P 2 2. 0 4 P 3 4. 0 1 P 4 5. 0 4 P 1 0 P 2 2 u Average P 3 4 P 2 5 P 4 7 P 1 11 16 waiting time = (9 + 1 + 0 +2)/4 = 3 컴퓨터공학과 운영체제 Page 24
o MLQ(Multi-level Queue) scheduling 4 ready queue를 여러 개의 큐로 분할 4 Process들을 그 특성에 따라 하나의 queue에 할당함 4 각 queue 별 scheduling 기법 필요 4 전체 queue 들간 scheduling 기법 필요 Higher priority System processes Interactive processes Batch processes Lower priority Student processes 컴퓨터공학과 운영체제 Page 29
MFQ 스케줄링 개념 higher priority RQ 0 RQ 1 completion RQ 2 Processor RQn lower priority timerrunout 컴퓨터공학과 운영체제 Page 32
Unix 환경에서의 프로세스 우선순위 Swapper Waiting for disk I/O not interruptible Waiting for buffer kernel mode priorities Waiting for inode Waiting for tty input interruptible. Waiting for tty output Processes Waiting for child exit Threshold priority User level 0 user mode priorities User level 1 User level n 컴퓨터공학과 운영체제 Page 36
Scheduling in Windows 2000 o 개요 4 Thread scheduling 4 Priority-based, preemptive scheduling 4 32 -level priority scheme ë Variable class: 1 -15 ë Real-time class: 16 -32 4 각 우선순위마다 하나씩의 큐 사용. 4 우선순위 높은 큐부터 서비스 컴퓨터공학과 운영체제 Page 39
Scheduling in Windows 2000 o Priority classes 4 REALTIME_PRIORITY_CLASS 4 HIGH_PRIORITY_CLASS 4 ABOVE_NORMAL_PRIORITY_CLASS 4 NORMAL _PRIORITY_CLASS 4 BELOW_NORMAL _PRIORITY_CLASS 4 IDLE _PRIORITY_CLASS o Relative priorities in each class 4 TIME_CRITICAL 4 HIGHEST 4 ABOVE_NORMAL 4 BELOW_NORMAL 4 LOWEST 4 IDLE 컴퓨터공학과 운영체제 Page 40
o Windows 2000 priorities real-time high above normal below normal idle time-critical 31 15 15 15 highest 26 15 12 10 8 6 above normal 25 14 11 9 7 5 normal 24 13 10 8 6 4 below normal 23 12 9 7 5 3 lowest 22 11 8 6 4 2 idle 16 1 1 1 컴퓨터공학과 운영체제 Base priority Page 41
Scheduling in Windows 2000 o Scheduling scheme 4 When a thread’s time quantum runs out, its priority is lowered (if it is in the variable priority class) 4 When a variable priority thread is released from a wait operation, the dispatcher boosts the priority ë The boost of amount depends on what the thread was waiting for 8 Keyboard or mouse I/O large increase 8 Disk I/O moderate increase 4 When a process moves into the foreground, the scheduling quantum may be increased by the factor of 3 컴퓨터공학과 운영체제 Page 42
Q 각 CPU 스케줄링 알고리즘들이 작업 요구량이 적은 short job 을 어떻게 다루는 지에 대해서 상호 비교 설명하시오. 1) First-In-First-Out 2) Round-Robin 3) Shortest-Process-Next 4) Shortest-Remaining-Time-Next 5) High-Response-Ratio-Next 6) Multi-level Feedback Queue 컴퓨터공학과 운영체제 Page 43
- Slides: 48