You are on page 1of 37

SCHEDULE

DIFF APPROACHES IN
SCHEDULING

Clk driven approach


HRT
Offline
Uses h/w Timer

2
DIFF APPROACHES IN
SCHEDULING

Weighted Round Robin


Round Robin-FIFO
1 (3)
2 (1)
3 (2)
4 (1)
Weighted wt is fraction of processor time
1 (3,2)
2 (1,1)
3 (2,2)
4 (1,1)
3
J1,1 J1,2

J2,1 J2,2

P1

P2

P1

P2

4
DIFF APPROACHES IN
SCHEDULING

Priority Approach
Class of algo that do not leave any resource free
Scheduling decision are made
Task is released Event-driven
Task is completed
Greedy
List

5
J1 - 3

J2 - 1 J3 - 2 J4 - 2

J5 released at 4
J5 - 2 J6 - 4
All other jobs at 0

J7 - 4 J8 - 1

6
P1 J1 J1 J1 J4 J4 J7 J7 J7 J6 J6 J6 J6
P2 J2 J3 J3 J7 J5 J5 J8

P1 J1 J1 J1 J4 J4 J5 J5 J6 J6 J6 J6
P2 J2 J3 J3 J7 J7 J7 J7 J8

7
EDF/LST

Not always optimal


J1 J2 J3
r 0 2 4
e 3 6 4
d 10 14 12
J1 J1 J1 J2 J3 J3 J3 J3 J2 J2 J2 J2 J2
EDF/LST

J1 J2 J3
r 0 0 0
e 1 1 5
d 1 2 5

10
EDF/LST

A B C D E

0 0 0 0 0
e 1 1 1 6 6
p 2 2 2 8 8

11
A
A D
D D
D D
D D B D D
BB EE EE BB E E E E
C
C A
A C
C A C A B
Multiprocessing Scheduling Algorithms
are mostly NP-Complete
INDETERMINISTIC

Priority Driven better than clk but was not


used till very recently
r d e
J1 0 10 5
J2 0 10 2-6
J3 4 15 8
J4 0 20 10
Maximal
1 1 1 1 1 3 3 3 3 3 3 3 3

2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4

Minimal

1 1 1 1 1

2 2 4 4 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4

Actual

1 1 1 1 1
2 2 2 4 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4

Actual

1 1 1 1 1 3 3 3 3 3 3 3 3
2 2 2 2 2 4 4 4 4 4 4 4 4 4 4
PREDICTABLE

Start
Finish
Predictable Execution not only depends on predictability of the
parameters but also the scheduler

Execution of every job in a set of independent, preemptable jobs with


fixed release time is predictable when scheduled in a priority-driven
manner on one processor
VALIDATION ALGORITHM

Determines whether all jobs in system meet


their timing constraints despite scheduling
anomalies
Robust
Inaccurate
Always Deterministic
Mostly Periodic
N- tasks N-fixed
All parameters of periodic tasks are known
apriori
Release Time Jitter minimal /negligble
Each job ready for exec at release time
Static,Time-Driven
OS- maintains a queue for aperiodic jobs
Offline schedule
Works as long as no job overruns
T1 = (1,4)
T2 = (2,5)
T3 = (1,20)
T4 = (2,20)
T11 T21 T21 T31 T12

T22 T22 T41 T41 T13

T23 T23 T14

T24 T24 T15


T11 T21 T21 T31 T12

T22 T22 T22 T13

T23 T23 T14 T41 T41

T15 T24 T24


This is a better
schedule Why ???
Store schedule in Table
Each Entry (tk T(tk ))
Gives a decision time tk
Schedule task / Idle Time
During initialization - OS creates all the
tasks that are to be executed
Time Task Time Task

0 T11 10 T23

1 T21 12 T14

3 T31 13 T41

4 T12 15 I

5 I 14 T15

6 T22 17 T24

8 T13 19 I

9 I 20 *
Variables i, k
i decision point
Start
i, k =0
Timer to expire at tk (t0 )
do forever
accept timer int
if aperiodic job executing
preempt
current task T = T(tk )
i = i +1
next table entry k = i mod (N)
set timer to expire i/N H + tk
if current task is I
let aperiodic task execute
else T executes
sleep
Make it more Cyclic
Cyclic Schedule
f pi(min)
f ei(max) divide the hyperperiod
pi/f - pi /f =0
f+(f gcd (f,pi) < Di
E = 1,14,15
F = 2,26,20
G = 3,22
Hyper period broken into frames of length f
Phase of any job non-integer multiple of
frame size
Job (Action) is broken into (Sub-Actions)
Slice/ Chunk/ Strip/ Scheduling Block
A = (1,10) B = (2,10), C = (2,20), D = (12,20)
D = D1,5 D2,7

f =10

You might also like