Presentation is loading. Please wait.

Presentation is loading. Please wait.

Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.

Similar presentations


Presentation on theme: "Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2."— Presentation transcript:

1 Peng Lu

2 CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2

3 1. Basic Concepts Alternating Sequence of CPU And I/O Bursts CPU Scheduler Preemptive Scheduling Dispatcher 3

4 Alternating Sequence of CPU And I/O Bursts 4

5 Histogram of CPU-burst Times 5

6 CPU Scheduler Short-term scheduler First-in, first-out (FIFO) 6

7 Preemptive Scheduling CPU scheduling decisions may take place when a process: 1.Switches from running to waiting state 2.Switches from running to ready state 3.Switches from waiting to ready state 4.Terminates Non-preemptive (1 and 4) Preemptive (All other) 7

8 Dispatcher Dispatcher involves: switching context switching to user mode jumping to the proper location in the user program to restart that program Dispatch latency 8

9 2. Scheduling Criteria CPU utilization Throughput Turnaround time Waiting time Response time 9

10 Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time 10

11 3. Scheduling Algorithms First-come, First-served (FCFS) Shortest-Job-First (SJF) Priority Round-Robin (RR) Multilevel Queue Multilevel Feedback Queue 11

12 First-Come, First-Served (FCFS) Process Burst Time P 1 24 P 2 3 P 3 3 If that the processes arrive in the order: P 1, P 2, P 3,, The Gantt Chart for the schedule is: P1P1 P2P2 P3P3 2427300 12

13 FCFS Scheduling (Cont.) If that the processes arrive in the order P 2, P 3, P 1 The Gantt chart for the schedule is: P1P1 P3P3 P2P2 63300 13

14 Shortest-Job-First (SJF) Process Burst Time P 1 6 P 2 8 P 3 7 P 4 3 14

15 Prediction of the Length of the Next CPU Burst 15

16 Priority Scheduling Process Burst Time Priority P 1 10 3 P 2 1 1 P 3 2 4 P 4 1 5 P 5 5 2 16

17 Priority Scheduling Indefinite blocking (Starvation) Aging 17

18 Round-Robin (RR) Time Quantum = 20 Process Burst Time P 1 53 P 2 17 P 3 68 P 4 24 P1P1 P2P2 P3P3 P4P4 P1P1 P3P3 P4P4 P1P1 P3P3 P3P3 02037577797117121134154162 18

19 Time Quantum and Context Switch Time 19

20 Turnaround Time Varies With The Time Quantum 20

21 Multilevel Queue 21

22 Multilevel Feedback Queues 22

23 4. Multiple-Processor Scheduling More complex when multiple CPUs are available Homogeneous Load sharing Asymmetric multiprocessing 23

24 5. Real-Time Scheduling Hard real-time Soft real-time 24

25 Summary Optimization Criteria Max CPU utilization, throughput; Min turnaround, waiting and response time FCFS, SJF, Priority, RR Multilevel Queue and Feedback Queue 25

26 6. Algorithm Evaluation Deterministic modeling Queueing models Simulations Implementation 26

27 Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling 27

28 Operating System Examples : Solaris 2 Scheduling 28

29 Solaris Dispatch Table 29

30 Operating System Examples : Windows XP 30

31 Operating System Examples : Linux Scheduling Time-sharing Real-time 31

32 The Relationship Between Priorities and Time- slice length 32


Download ppt "Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2."

Similar presentations


Ads by Google