Scheduling algorithms(p388) ☆ Decision mode(调度模式) Nonpreemptive(非抢占): Once a process is in the running state. it continues to execute until it terminates or blocks itself to wait for 1O or by requesting some OS service. often used in batch system Preemptive(抢占): The running process may be interrupted to ready state. often used in time-sharing or real-time system ° Preemptive policies incure(引入) greater overhead than nonpreemptive ones but provide better service. PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Scheduling Algorithms(p388) ❖ Decision mode(调度模式) ٭ Nonpreemptive(非抢占): Once a process is in the running state, it continues to execute until it terminates or blocks itself to wait for I/O or by requesting some OS service. Often used in batch system. ٭ Preemptive(抢占): The running process may be interrupted to ready state. Often used in time-sharing or real-time system. ٭ Preemptive policies incur(引入) greater overhead than nonpreemptive ones but provide better service
Exampl ls(p388) ☆ Five processes P rocess Arrival Time Service Time ABCDE 02468 36452 PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Examples (p388) ❖Five processes
Analysis(p389~390) 4 Using Six scheduling algorithms in the example, calculates the average turnaround(a#)time and (Tq/ts)(fig 9.5& Table 9.4) PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Analysis(p389~390) ❖ Using six scheduling algorithms in the example, calculates the average turnaround(周转) time, and (Tq / Ts)(Fig 9.5 & Table 9.4)
ocess Arrival Time Service Time(T, 582 FCFS Finish Time 0333 22697 13 Turnaround Time(T) 18 7/T 1.0 1.17 12 225 240 D 600 q Finish Time 17 Turnaround Time( To) 20 16 T/T, 13 133 267 3.26 280 3.50 RR 9=4 Finish Time 17 Turnaround Time(T) 15 T/T 11 2.5 1.75 550 SPN Finish Time 3 Turnaround Time(T) T9/T, 100 117 280 150 SRT Finish Time 15 Turnaround Time( 3 T/T 14 2 2.17 100 280 1.00 HRRN Finish Time 9 13 Turnaround Time(Ta) 15 T/7 1.00 7 117 225 280 3.5 FB q=1 Finish Time 20 Turnaround Time(T 19 18 TO/T, 1.33 3.00 3.00 15 FB q=2(-) Finish Tim Tumaround Time (Ta) 17 TNT. 15 1.33 14 2.80
PROCESSES AND SCHEDULING
First Come First Served (FCFS) 15 20 PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING First Come First Served(FCFS) 0 5 10 15 20 1 2 3 4 5