cpu schedulin… · (chapter 6: “scheduling” up to page 458) performance scheduling round robin...

4
433 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 433 of 757 (chapter 6: “Scheduling” up to page 458) Definition of terms Time scales of scheduling CPU y d a e r ready, suspended blocked, suspended blocked pre-emption or cycle done block or synchronize executing dispatch suspend (swap-out) swap-in swap-out unblock suspend (swap-out) Short-term Medium-term 430 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 430 of 757 (chapter 6: “Scheduling” up to page 458) Motivation and definition of terms Purpose of scheduling Two scenarios for scheduling algorithms: 1. Ordering resource assignments (CPU time, network access, …). G live, on-line application of scheduling algorithms. 2. Predicting system behaviours under anticipated loads. G simulated, off-line application of scheduling algorithms. Predictions are used: at compile time: to confirm the feasibility of the system, or to predict resource needs, … at run time: to permit admittance of new requests or for load-balancing, … 427 6 Scheduling Uwe R. Zimmer - The Australian National University Systems, Networks & Concurrency 2019 434 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 434 of 757 (chapter 6: “Scheduling” up to page 458) Definition of terms Time scales of scheduling CPU creation y d a e r h c t a b ready, suspended blocked, suspended blocked pre-emption or cycle done terminate. block or synchronize executing admit dispatch suspend (swap-out) swap-in swap-out unblock suspend (swap-out) Long-term Short-term Medium-term 431 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 431 of 757 (chapter 6: “Scheduling” up to page 458) Motivation and definition of terms Criteria Performance criteria: Predictability criteria: Process / user perspective: minimize the … minimize deviation from given … Waiting time minima / maxima / average / variance value / minima / maxima Response time minima / maxima / average / variance value / minima / maxima / deadlines Turnaround time minima / maxima / average / variance value / minima / maxima / deadlines System perspective: maximize the … Throughput minima / maxima / average Utilization CPU busy time 428 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 428 of 757 (chapter 6: “Scheduling” up to page 458) References for this chapter [Ben2006] Ben-Ari, M Principles of Concurrent and Dis- tributed Programming second edition, Prentice-Hall 2006 [AdaRM2012] Ada Reference Manual - Lan- guage and Standard Libraries; ISO/IEC 8652:201x (E) [Stallings2001] Stallings, William Operating Systems Prentice Hall, 2001 435 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 435 of 757 (chapter 6: “Scheduling” up to page 458) Performance scheduling Requested resource times time 0 5 10 15 20 25 30 35 40 45 (T i , C i ) (4, 1) (12, 3) (16, 8) Tasks have an average time between instantiations of T i and a constant computation time of C i 432 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 432 of 757 (chapter 6: “Scheduling” up to page 458) Definition of terms Time scales of scheduling CPU y d a e r blocked pre-emption or cycle done block or synchronize executing dispatch Short-term 429 Scheduling © 2019 Uwe R. Zimmer, The Australian National University page 429 of 757 (chapter 6: “Scheduling” up to page 458) Motivation and definition of terms Purpose of scheduling

Upload: others

Post on 07-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CPU Schedulin… · (chapter 6: “Scheduling” up to page 458) Performance scheduling Round Robin (RR) time 0 5 10152025 30354045 (T i, C i) (16, 8) (12, 3) (4, 1) Waiting time:

433

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

433

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Defi

nit

ion

of t

erm

s

Tim

e sc

ales

of s

ched

ulin

g

CPU

ydaer

read

y, s

usp

end

ed

blo

cked

, su

spen

ded

blo

ckedp

re-e

mp

tio

n o

r cy

cle

do

ne

blo

ck o

r sy

nch

ron

ize

exec

uti

ng

dis

pat

ch susp

end

(sw

ap-o

ut)

swap

-in

swap

-out

un

blo

ck

susp

end

(sw

ap-o

ut)

Short-term

Med

ium-term

430

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

430

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Mot

ivat

ion

and

defi

niti

on o

f ter

ms

Purp

ose

of s

ched

ulin

g

Two

sce

nar

ios

for

sch

edu

ling

algo

rith

ms:

1. O

rder

ing

reso

urc

e as

sign

men

ts (C

PU ti

me,

net

wo

rk a

cces

s, …

). l

ive,

on

-lin

e ap

plic

atio

n o

f sch

edu

ling

algo

rith

ms.

2. P

red

icti

ng

syst

em b

ehav

iou

rs u

nd

er a

nti

cip

ated

load

s. s

imu

late

d, o

ff-l

ine

app

licat

ion

of s

ched

ulin

g al

gori

thm

s.

Pred

icti

on

s ar

e u

sed

:

• at

co

mp

ile t

ime:

to c

on

fi rm

the

feas

ibili

ty o

f th

e sy

stem

, or

to p

red

ict r

eso

urc

e n

eed

s, …

• at

ru

n t

ime:

to p

erm

it a

dm

itta

nce

of n

ew r

equ

ests

or

for

load

-bal

anci

ng,

427

6Sc

hedu

ling

Uw

e R

. Zim

mer

- T

he A

ustr

alia

n N

atio

nal U

nive

rsity

Syst

ems,

Net

wo

rks

& C

on

curr

ency

201

9

434

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

434

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Defi

nit

ion

of t

erm

s

Tim

e sc

ales

of s

ched

ulin

g

CPU

crea

tio

ny

daerhcta

b

read

y, s

usp

end

ed

blo

cked

, su

spen

ded

blo

ckedp

re-e

mp

tio

n o

r cy

cle

do

ne

term

inat

e.

blo

ck o

r sy

nch

ron

ize

exec

uti

ng

adm

it

dis

pat

ch susp

end

(sw

ap-o

ut)

swap

-in

swap

-out

un

blo

ck

susp

end

(sw

ap-o

ut)

Long

-term

Short-term

Med

ium-term

431

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

431

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Mot

ivat

ion

and

defi

niti

on o

f ter

ms

Cri

teri

a

Perf

orm

ance

cri

teri

a:Pr

edic

tabi

lity

crit

eria

:

Pro

cess

/ u

ser

per

spec

tive

:

min

imiz

e th

e …

min

imiz

e d

evia

tio

n fr

om

giv

en …

Wai

ting

tim

em

inim

a / m

axim

a / a

vera

ge /

vari

ance

valu

e / m

inim

a / m

axim

a

Res

pons

e ti

me

min

ima

/ max

ima

/ ave

rage

/ va

rian

ceva

lue

/ min

ima

/ max

ima

/ dea

dlin

es

Turn

arou

nd t

ime

min

ima

/ max

ima

/ ave

rage

/ va

rian

ceva

lue

/ min

ima

/ max

ima

/ dea

dlin

es

Syst

em p

ersp

ecti

ve: m

axim

ize

the

Thro

ughp

utm

inim

a / m

axim

a / a

vera

ge

Uti

lizat

ion

CPU

bu

sy ti

me

428

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

428

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Ref

eren

ces

for

this

cha

pter

[ Ben

2006

] B

en-A

ri, M

Pr

inci

ple

s o

f Co

ncu

rren

t an

d D

is-

trib

ute

d P

rogr

amm

ing

seco

nd

ed

itio

n, P

ren

tice

-Hal

l 200

6

[Ad

aRM

2012

]A

da

Refe

ren

ce M

anu

al -

Lan

-gu

age

and

Sta

nd

ard

Lib

rari

es;

ISO

/IEC

865

2:20

1x (E

)

[ Sta

lling

s200

1 ] St

allin

gs, W

illia

m

Op

erat

ing

Syst

ems

Pren

tice

Hal

l, 20

01

435

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

435

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Req

uest

ed r

eso

urce

tim

es

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Task

s h

ave

an a

vera

ge t

ime

betw

een

inst

anti

atio

ns o

f T

i

and

a c

on

stan

t com

puta

tion

tim

e o

f C

i

432

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

432

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Defi

nit

ion

of t

erm

s

Tim

e sc

ales

of s

ched

ulin

g

CPU

ydaer b

lock

edpre

-em

pti

on

or

cycl

e d

on

e

blo

ck o

r sy

nch

ron

ize

exec

uti

ng

dis

pat

ch

Short-term

429

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

429

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Mot

ivat

ion

and

defi

niti

on o

f ter

ms

Purp

ose

of s

ched

ulin

g

Page 2: CPU Schedulin… · (chapter 6: “Scheduling” up to page 458) Performance scheduling Round Robin (RR) time 0 5 10152025 30354045 (T i, C i) (16, 8) (12, 3) (4, 1) Waiting time:

442

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

442

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Sho

rtes

t jo

b fi

rst

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..11,

ave

rage

: 3.7

– T

urna

roun

d ti

me:

1..1

4, a

vera

ge: 6

.3

Op

tim

ized

for

goo

d a

vera

ge p

erfo

rman

ce w

ith

min

imal

task

-sw

itch

es.

Pre

fers

sh

ort

task

s b

ut a

ll ta

sks

will

be

han

dle

d.

Goo

d ch

oice

if c

ompu

tati

on t

imes

are

kno

wn

and

task

sw

itch

es a

re e

xpen

sive

!

439

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

439

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Feed

bac

k w

ith

2i p

re-e

mp

tio

n in

terv

als

• Im

ple

men

t mu

ltip

le

hie

rarc

hic

al r

ead

y-q

ueu

es.

• Fe

tch

pro

cess

es fr

om

the

hig

hes

t fi ll

ed r

ead

y q

ueu

e.

• D

isp

atch

mo

re C

PU ti

me

for

low

er p

rio

riti

es (

2i un

its)

.

Pro

cess

es o

n lo

wer

ran

ks

may

su

ffer

sta

rvat

ion.

New

an

d s

ho

rt ta

sks

will

be

pre

ferr

ed.

CPU

pri

ori

ty 0

pri

ori

ty 1

exec

uti

ng

adm

it

dis

pat

ch 2

0

pri

ori

ty i

dis

pat

ch 2

1

dis

pat

ch 2

i

436

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

436

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Firs

t co

me,

fi rs

t se

rved

(FC

FS)

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..11,

ave

rage

: 5.9

– T

urna

roun

d ti

me:

3..1

2, a

vera

ge: 8

.4

As

task

s ap

ply

co

ncu

rren

tly

for

reso

urc

es, t

he

actu

al s

equ

ence

of a

rriv

al is

no

n-d

eter

min

isti

c. h

ence

eve

n a

det

erm

inis

tic

sch

edu

ling

sch

ema

like

FCFS

can

lead

to d

iffe

ren

t ou

tco

mes

.

443

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

443

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Sho

rtes

t jo

b fi

rst

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..10,

ave

rage

: 3.4

– T

urna

roun

d ti

me:

1..1

4, a

vera

ge: 6

.0

Can

be

sen

siti

ve to

no

n-d

eter

min

isti

c ar

riva

l seq

uen

ces.

440

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

440

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Feed

bac

k w

ith

2i p

re-e

mp

tio

n in

terv

als

- se

que

ntia

l tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..5, a

vera

ge: 1

.5 –

Tur

naro

und

tim

e: 1

..21,

ave

rage

: 5.7

Op

tim

ized

for

swif

t in

itia

l res

po

nse

s.

Pre

fers

sh

ort

task

s an

d lo

ng

task

s ca

n s

uff

er s

tarv

atio

n.

Ver

y sh

ort

init

ial r

espo

nse

tim

es! a

nd

go

od

ave

rage

turn

aro

un

d ti

mes

.

437

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

437

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Firs

t co

me,

fi rs

t se

rved

(FC

FS)

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..11,

ave

rage

: 5.4

– T

urna

roun

d ti

me:

3..1

2, a

vera

ge: 8

.0

In

this

exa

mp

le:

the

aver

age

wai

tin

g ti

mes

var

y b

etw

een

5.4

an

d 5

.9th

e av

erag

e tu

rnar

ou

nd

tim

es v

ary

bet

wee

n 8

.0 a

nd

8.4

Sho

rtes

t po

ssib

le m

axim

al t

urna

roun

d ti

me!

444

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

444

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Hig

hest

Res

po

nse

Rat

ion

CW

Ci

ii

+ F

irst

(HR

RF)

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..9, a

vera

ge: 4

.1 –

Tur

naro

und

tim

e: 2

..13,

ave

rage

: 6.6

Ble

nd

bet

wee

n S

ho

rtes

t-Jo

b-F

irst

an

d F

irst

-Co

me-

Firs

t-Se

rved

.

Pre

fers

sh

ort

task

s b

ut l

on

g ta

sks

gain

pre

fere

nce

ove

r ti

me.

Mor

e ta

sk s

wit

ches

and

wor

se a

vera

ges

than

SJF

but

bet

ter

uppe

r bo

unds

!

441

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

441

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Feed

bac

k w

ith

2i p

re-e

mp

tio

n in

terv

als

- ov

erla

pp

ing tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..3, a

vera

ge: 0

.9 –

Tur

naro

und

tim

e: 1

..45,

ave

rage

: 7.7

Op

tim

ized

for

swif

t in

itia

l res

po

nse

s.

Pre

fers

sh

ort

task

s an

d lo

ng

task

s ca

n s

uff

er s

tarv

atio

n.

Lon

g ta

sks

are

dela

yed

unti

l all

queu

es r

un e

mpt

y!

438

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

438

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Roun

d R

ob

in (R

R)

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..5, a

vera

ge: 1

.2 –

Tur

naro

und

tim

e: 1

..20,

ave

rage

: 5.8

Op

tim

ized

for

swif

t in

itia

l res

po

nse

s.

“St

retc

hes

ou

t” lo

ng

task

s.

Bou

nd m

axim

al w

aiti

ng t

ime!

(d

epen

ded

on

ly o

n th

e n

um

ber

of t

asks

)

Page 3: CPU Schedulin… · (chapter 6: “Scheduling” up to page 458) Performance scheduling Round Robin (RR) time 0 5 10152025 30354045 (T i, C i) (16, 8) (12, 3) (4, 1) Waiting time:

451

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

451

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

over

view

Sele

ctio

nPr

e-em

pti

on

Wai

tin

gTu

rnar

ou

nd

Pref

erre

d

job

sSt

arva

tio

n

po

ssib

le?

Met

ho

ds

wit

ho

ut a

ny

kno

wle

dge

ab

ou

t th

e p

roce

sses

FCFS

()

max

Wi

no

lon

glo

ng

aver

age

&

sho

rt m

axim

um

equ

aln

o

RR

equ

al s

har

eye

sb

ou

nd

goo

d a

vera

ge &

la

rge

max

imu

msh

ort

no

FBp

rio

rity

q

ueu

esye

sve

ry s

ho

rtsh

ort

ave

rage

&

lon

g m

axim

um

sho

rtn

o

Met

ho

ds

emp

loyi

ng

com

pu

tati

on

tim

e C

i an

d e

lap

sed

tim

e E i

SJF

()

min

Ci

no

med

ium

med

ium

sho

rtye

s

HR

RF

()

max

CW

Ci

ii

+n

oco

ntr

olla

ble

co

mp

rom

ise

con

tro

llab

le

com

pro

mis

eco

ntr

olla

ble

no

SRTF

()

min

CE

ii

-ye

sve

ry s

ho

rtw

ide

vari

ance

sho

rtye

s

448

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

448

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

by s

hort

est

aver

age

wai

ting

tim

e0

510

1520

2530

3540

45

FCFS

FCFS

RR

FB-

seq

.

FB-

ovl

p

SJF

SJF

HR

RF

SRTF

Pro

vid

ing

sho

rt a

vera

ge w

aiti

ng

tim

es

Ver

y sw

ift r

esp

on

se in

mo

st c

ases

Wai

tin

g ti

mes

Turn

aro

un

d ti

mesAve

rage

s

445

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

445

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Sho

rtes

t Re

mai

ning

Tim

e Fi

rst

(SRT

F)

tim

e0

510

1520

2530

3540

45(T

i, C

i)

(4, 1

)

(12,

3)

(16,

8)

Wai

ting

tim

e: 0

..6, a

vera

ge: 0

.7 –

Tur

naro

und

tim

e: 1

..21,

ave

rage

: 4.4

Op

tim

ized

for

goo

d a

vera

ges.

Pre

fers

sh

ort

task

s an

d lo

ng

task

s ca

n s

uff

er s

tarv

atio

n..

Bet

ter

aver

ages

tha

n Fe

edba

ck s

ched

ulin

g bu

t w

ith

long

er a

bsol

ute

wai

ting

tim

es!

452

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

452

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Tow

ard

s p

red

icta

ble

sch

edul

ing

Task

req

uir

emen

ts (Q

ual

ity

of s

ervi

ce):

Gu

aran

tee

data

fl ow

leve

ls

Gu

aran

tee

reac

tion

tim

es

Gu

aran

tee

dead

lines

Gu

aran

tee

deliv

ery

tim

es

Pro

vid

e bo

unds

for

the

vari

atio

ns in

res

ult

s

Exam

ple

s:

• St

ream

ing

med

ia b

road

cast

s, p

layi

ng

HD

vid

eos,

live

mix

ing

aud

io/v

ideo

, …

• R

eact

ing

to u

sers

, Rea

ctin

g to

ala

rm s

itu

atio

ns,

• D

eliv

erin

g a

sign

al to

the

ph

ysic

al w

orl

d a

t th

e re

qu

ired

tim

e, …

449

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

449

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

by s

hort

est

max

imal

tur

naro

und

tim

e0

510

1520

2530

3540

45

FCFS

FCFS

RR

FB-

seq

.FB

-o

vlp

SJF

SJF

HR

RF

SRTF

Pro

vid

ing

up

per

bo

un

ds

to tu

rnar

ou

nd

tim

es

No

task

s ar

e le

ft b

ehin

d

Wai

tin

g ti

mes

Turn

aro

un

d ti

mesAve

rage

s

446

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

446

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

(in o

rder

of a

pp

eara

nce)

tim

e0

510

1520

2530

3540

45

FCFS

FCFS

RR

FB-

seq

.FB

-o

vlp

SJF

SJF

HR

RF

SRTF

Wai

tin

g ti

mes

Turn

aro

un

d ti

mesAve

rage

s

453

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

453

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Tem

po

ral s

cop

es

Co

mm

on

att

rib

ute

s:

• M

inim

al &

max

imal

de

lay

afte

r cr

eati

on

• M

axim

al e

laps

ed t

ime

• M

axim

al e

xecu

tion

tim

e

• A

bso

lute

dea

dlin

eTa

sk i

t1

0352

025

10

dea

dlin

e

min

. del

aym

ax. d

elay

crea

ted

max

. ela

pse

tim

em

ax. e

xec.

tim

e

450

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

450

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

by s

hort

est

aver

age

turn

aro

und

tim

e0

510

1520

2530

3540

45

FCFS

FCFS

RR

FB-

seq

.

FB-

ovl

p

SJF

SJF

HR

RF

SRTF

Pro

vid

ing

goo

d a

vera

ge p

erfo

rman

ce

Hig

h th

rou

ghp

ut s

yste

ms

Wai

tin

g ti

mes

Turn

aro

un

d ti

mesAve

rage

s

447

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

447

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Perf

orm

ance

sch

edul

ing

Co

mp

aris

on

by s

hort

est

max

imal

wai

ting

tim

e0

510

1520

2530

3540

45

FCFS

FCFS

RR

FB-

seq

.FB

-o

vlp

SJF

SJF

HR

RF

SRTF

Pro

vid

ing

up

per

bo

un

ds

to w

aiti

ng

tim

es

Sw

ift r

esp

on

se s

yste

ms

Wai

tin

g ti

mes

Turn

aro

un

d ti

mesAve

rage

s

Page 4: CPU Schedulin… · (chapter 6: “Scheduling” up to page 458) Performance scheduling Round Robin (RR) time 0 5 10152025 30354045 (T i, C i) (16, 8) (12, 3) (4, 1) Waiting time:

457

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

457

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Co

mm

on

tem

po

ral s

cop

e at

trib

utes

Tem

pora

l sco

pes

can

be:

Peri

odic

co

ntr

olle

rs, r

ou

ters

, sch

edu

lers

, str

eam

ing

pro

cess

es, …

Ape

riod

ic p

erio

dic

‘on

ave

rage

’ tas

ks, i

.e. r

egu

lar

bu

t no

t rig

idly

tim

ed, …

Spor

adic

/ T

rans

ient

use

r re

qu

ests

, ala

rms,

I/O

inte

ract

ion

, …

Dea

dlin

es c

an b

e:

“Har

d” s

ingl

e fa

ilure

lead

s to

sev

ere

mal

fun

ctio

n a

nd

/or

dis

aste

r

“Fir

m”

res

ult

s ar

e m

ean

ingl

ess

afte

r th

e d

ead

line

on

ly m

ult

iple

or

per

man

ent f

ailu

res

lead

to m

alfu

nct

ion

“Sof

t” r

esu

lts

are

still

use

ful a

fter

the

dea

dlin

e

© 2

019

Uw

e R

. Zim“

Semantics defi ned by application

454

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

454

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Tem

po

ral s

cop

es

Co

mm

on

att

rib

ute

s:

• M

inim

al &

max

imal

de

lay

afte

r cr

eati

on

• M

axim

al e

laps

ed t

ime

• M

axim

al e

xecu

tion

tim

e

• A

bso

lute

dea

dlin

eTa

sk i

t1

0352

025

10

dea

dlin

e

min

. del

aym

ax. d

elay

acti

vate

dcr

eate

d

max

. ela

pse

tim

em

ax. e

xec.

tim

e

458

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

458

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Sum

mar

y

Sche

dul

ing

• B

asic

per

form

ance

sch

edul

ing

• M

oti

vati

on

& T

erm

s

• Le

vels

of k

no

wle

dge

/ as

sum

pti

on

s ab

ou

t th

e ta

sk s

et

• Ev

alu

atio

n o

f per

form

ance

an

d s

elec

tio

n o

f ap

pro

pri

ate

met

ho

ds

• To

war

ds p

redi

ctab

le s

ched

ulin

g

• M

oti

vati

on

& T

erm

s

• C

ateg

ori

es &

Exa

mp

les

455

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

455

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Tem

po

ral s

cop

es

Co

mm

on

att

rib

ute

s:

• M

inim

al &

max

imal

de

lay

afte

r cr

eati

on

• M

axim

al e

laps

ed t

ime

• M

axim

al e

xecu

tion

tim

e

• A

bso

lute

dea

dlin

eTa

sk i

t1

0352

025

10

dea

dlin

e

min

. del

aym

ax. d

elay

acti

vate

d susp

end

edre-a

ctiv

ated

term

inat

ed

crea

ted

elap

se ti

me

max

. ela

pse

tim

em

ax. e

xec.

tim

e

456

Sch

edu

ling

© 2

019

Uw

e R

. Zim

mer

, The

Aus

tral

ian

Nat

iona

l Uni

vers

ity

page

456

of 7

57 (c

hapt

er 6

: “Sc

hedu

ling”

up

to p

age

458)

Pred

icta

ble

sche

dulin

g

Tem

po

ral s

cop

es

Co

mm

on

att

rib

ute

s:

• M

inim

al &

max

imal

de

lay

afte

r cr

eati

on

• M

axim

al e

laps

ed t

ime

• M

axim

al e

xecu

tion

tim

e

• A

bso

lute

dea

dlin

eTa

sk i

t1

0352

025

10

dea

dlin

e

exec

uti

on

tim

e

min

. del

aym

ax. d

elay

acti

vate

d susp

end

edre-a

ctiv

ated

term

inat

ed

crea

ted

elap

se ti

me

max

. ela

pse

tim

em

ax. e

xec.

tim

e