scheduling mechanisms and policies - computer action...

107
1 Chapter 2 (Fourth Part) Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew Tanenbaum

Upload: hamien

Post on 28-Mar-2018

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

1

Chapter 2 (Fourth Part)

Scheduling Mechanisms and Policies

Slide Credits: Jonathan Walpole

Andrew Tanenbaum

Page 2: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

2

Process state model

New Process Ready

Blocked

Running Termination

Page 3: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

3

CPU scheduling criteria

CPU Utilization – How busy is the CPU?

Throughput – How many jobs finished (per unit time)?

Turnaround Time – How long from job submission to job termination?

Response Time – How long (on average) does it take to get a “response” from a “stimulus”?

Missed deadlines – Were any deadlines missed?

Page 4: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

4

Scheduler Options

Priorities May use priorities to determine who runs next

amount of memory, order of arrival, etc..

Dynamic vs. Static algorithms Dynamically alter the priority of the tasks while they are in

the system (possibly with feedback) Static algorithms typically assign a fixed priority when the

job is initially started.

Preemptive vs. Nonpreemptive Preemptive systems allow the task to be interrupted at

any time so that the O.S. can take over again.

Page 5: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

5

Scheduling Policies

First-Come, First Served (FIFO) Shortest Job First (non-premeptive) Shortest Job First (with preemption) Round-Robin Scheduling Priority Scheduling Real-Time Scheduling

Page 6: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

6

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

Page 7: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

7

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 8: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

8

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 9: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

9

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Arrival Times of the Jobs

Page 10: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

10

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 11: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

11

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 12: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

12

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 13: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

13

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 14: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

14

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 15: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

15

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 16: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

16

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 17: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

17

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 18: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

18

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 19: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

19

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 20: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

20

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 21: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

21

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Total time taken, From submission to

completion

Page 22: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

22

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 2 2 6 1 3 4 4 5 4 6 5 7 5 8 2 10

Total time taken, From submission to

completion

Page 23: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

23

First-Come, First-Served (FIFO)

Start jobs in the order they arrive (FIFO queue) Run each job until completion

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 3 2 2 6 1 7 3 4 4 5 9 4 6 5 7 12 5 8 2 10 12

Total time taken, From submission to

completion

Page 24: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

24

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

Page 25: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

25

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Same Job Mix

Page 26: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

26

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 27: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

27

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 28: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

28

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 29: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

29

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 30: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

30

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 31: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

31

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 32: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

32

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 33: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

33

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 34: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

34

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 35: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

35

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 36: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

36

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 37: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

37

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 38: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

38

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 2 2 6 1 3 4 4 7 4 6 5 9 5 8 2 1

Page 39: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

39

Shortest Job First

Select the job with the shortest (expected) running time Non-Preemptive

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 3 2 2 6 1 7 3 4 4 7 11 4 6 5 9 14 5 8 2 1 3

Page 40: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

40

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Same Job Mix

Page 41: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

41

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 42: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

42

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 43: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

43

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 44: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

44

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 45: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

45

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 46: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

46

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 47: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

47

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 48: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

48

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 49: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

49

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 50: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

50

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 51: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

51

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 52: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

52

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 53: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

53

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 54: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

54

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 2 2 6 7 3 4 4 0 4 6 5 9 5 8 2 0

Page 55: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

55

Shortest Remaining Time

Preemptive version of SJF

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 0 3 2 2 6 7 13 3 4 4 0 4 4 6 5 9 14 5 8 2 0 2

Page 56: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

56

Round-Robin Scheduling

Goal: Enable interactivity

Limit the amount of CPU that a process can have at one time.

Time quantum Amount of time the OS gives a process before intervention The “time slice” Typically: 1 to 100ms

Page 57: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

57

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 58: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

58

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 59: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

59

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 60: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

60

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 61: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

61

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 62: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

62

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 63: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

63

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 64: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

64

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 65: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

65

Ready List:

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 66: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

66

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 67: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

67

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 68: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

68

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 69: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

69

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 70: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

70

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 71: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

71

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 72: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

72

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 73: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

73

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 74: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

74

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 75: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

75

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 76: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

76

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 77: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

77

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 78: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

78

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 79: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

79

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 80: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

80

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 81: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

81

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 82: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

82

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Ready List:

Page 83: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

83

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Process Time Time 1 0 3 2 2 6 3 4 4 4 6 5 5 8 2

Page 84: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

84

Round-Robin Scheduling

0 5 10 15 20

Arrival Processing Turnaround Process Time Time Delay Time 1 0 3 1 4 2 2 6 10 16 3 4 4 9 13 4 6 5 9 14 5 8 2 5 7

Page 85: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

85

Round-Robin Scheduling

Effectiveness of round-robin depends on • The number of jobs, and • The size of the time quantum.

Large # of jobs means that the time between scheduling of a single job increases

(Slow responses)

Larger time quantum means that the time between the scheduling of a single job also increases

(Slow responses)

Smaller time quantum means higher processing rates but also more overhead!

Page 86: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

86

Scheduling in general purpose systems

Page 87: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

87

Priority scheduling

Assign a priority (number) to each process. Schedule processes based on its priority. Higher priority jobs processes get more CPU time.

Managing priorities Can use “nice” to reduce your priority Can periodically adjust a process’ priority

Prevents starvation of a lower priority process Can improve performance of I/O-bound processes

p = aT0 + (1-a)T1 efficient to calculate when a = 1/2

Can use feedback to help determine the priorities priority = 1/fraction last quantum used

Page 88: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

88

Multi-Level Queue Scheduling

Multiple queues, each with its own priority. (Equivalently: Each priority has its own ready queue)

Within each queue... Round-robin scheduling.

Simplist Approach: A Process’s priority is fixed & unchanging

CPU

High priority

Low priority

Page 89: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

89

Multi-Level Feedback Queue Scheduling

Problem: Fixed priorities are too restrictive Processes exhibit varying ratios of CPU to I/O times.

Dynamic Priorities Priorities are altered over time, as process behavior changes!

Page 90: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

90

Multi-Level Feedback Queue Scheduling

Problem: Fixed priorities are too restrictive Processes exhibit varying ratios of CPU to I/O times.

Dynamic Priorities Priorities are altered over time, as process behavior changes!

Issue: When do you change the priority of a process and how often?

Page 91: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

91

Multi-Level Feedback Queue Scheduling

Problem: Fixed priorities are too restrictive Processes exhibit varying ratios of CPU to I/O times.

Dynamic Priorities Priorities are altered over time, as process behavior changes!

Issue: When do you change the priority of a process and how often?

Solution: Let the amount of CPU used be an indication of how a process is to be handled Expired time quantum more processing needed Unexpired time quantum less processing needed

Adjusting quantum and frequency vs. adjusting priority??

Page 92: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

92

Multi-Level Feedback Queue Scheduling

n priority levels, round-robin scheduling within a level Quanta increase as priority decreases Jobs are demoted to lower priorities if they do not

complete within the current quantum

CPU

High priority

Low priority

??

Page 93: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

93

Multi-Level Feedback Queue Scheduling

Details, details, details...

• Starting priority?

• High priority vs. low priority

• Moving between priorities?

• How long should the time quantum be?

Page 94: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

94

Lottery Scheduling

Scheduler gives each thread some lottery tickets. To select the next process to run...

The scheduler randomly selects a lottery number The winning process gets to run

Example Thread A gets 50 tickets Thread B gets 15 tickets Thread C gets 35 tickets

There are 100 tickets outstanding.

Page 95: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

95

Lottery Scheduling

Scheduler gives each thread some lottery tickets. To select the next process to run...

The scheduler randomly selects a lottery number The winning process gets to run

Example Thread A gets 50 tickets 50% of CPU Thread B gets 15 tickets 15% of CPU Thread C gets 35 tickets 35% of CPU

There are 100 tickets outstanding.

Page 96: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

96

Lottery Scheduling

Scheduler gives each thread some lottery tickets. To select the next process to run...

The scheduler randomly selects a lottery number The winning process gets to run

Example Thread A gets 50 tickets 50% of CPU Thread B gets 15 tickets 15% of CPU Thread C gets 35 tickets 35% of CPU

There are 100 tickets outstanding. • Flexible • Fair • Responsive.

Page 97: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

97

A Brief Look at Real-Time Systems

Assume processes are relatively periodic Fixed amount of work per period (e.g. sensor systems or multimedia data)

Page 98: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

98

A Brief Look at Real-Time Systems

Assume processes are relatively periodic Fixed amount of work per period (e.g. sensor systems or multimedia data)

Two “main” types of schedulers...

Rate-Monotonic Schedulers

Earliest-Deadline-First Schedulers

Page 99: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

99

A Brief Look at Real-Time Systems

Assume processes are relatively periodic Fixed amount of work per period (e.g. sensor systems or multimedia data)

Two “main” types of schedulers...

Rate-Monotonic Schedulers Assign a fixed, unchanging priority to each process No dynamic adjustment of priorities

• Less aggressive allocation of processor

Earliest-Deadline-First Schedulers Assign dynamic priorities based upon deadlines.

Page 100: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

100

A Brief Look at Real-Time Systems

Typically real-time systems involve several steps (that aren’t in traditional systems)

• Admission control All processes must ask for resources ahead of time. If sufficient resources exist, the job is admitted “into” the system.

• Resource allocation Upon admission... the appropriate resources need to be reserved for the task.

• Resource enforcement Carry out the resource allocations properly.

Page 101: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

101

Rate Monotonic Schedulers

For preemptable, periodic processes (tasks)

Assigns a fixed priority to each task T = The period of the task C = The amount of processing per task

In RMS scheduling, the question to answer is... What priority should be assigned to a given task?

Process P1 T = 1 second C = 1/2 second / period

Page 102: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

102

Rate Monotonic Schedulers

P1

P2

Page 103: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

103

Rate Monotonic Schedulers

P1PRI > P2PRI

P2PRI > P1PRI

P1

P2

Page 104: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

104

Rate Monotonic Schedulers

P1PRI > P2PRI

P2PRI > P1PRI

P1

P2

The computation for P2 cannot be increased

Page 105: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

105

Rate Monotonic Schedulers

Assign shortest period tasks to the highest priorities

Admission control is difficult... < 70% There is a standard formula. > 70% It may be possible,

but need to do more complex analysis.

Page 106: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

106

Rate Monotonic Schedulers

Assumptions: • Processes complete (yield) within their period • Independent processes • Same CPU requirements per burst • Other non-periodic processes have no deadlines • Instantaneous preemption with no overhead

Page 107: Scheduling Mechanisms and Policies - Computer Action …web.cecs.pdx.edu/~harry/os/slides/Ch2d-Sched.pdf · Scheduling Mechanisms and Policies Slide Credits: Jonathan Walpole Andrew

107

Earliest Deadline First

When processes do not need periodic execution or have constant CPU requirements...

When processes have deadline specifications...

Unlike RMS, EDF uses dynamic priorities (based upon earliest deadline first)

(+) 100% processor utilization …? (-) Need to keep track of deadlines

Admission Control Just check to see if 100% processor utilization. Sum the Ci/Ti’s and see if less than or equal to 1 What about overhead?