Prorty-Based Shedulng (Perod Tasks) A preemptve method here the prorty of the proess determnes hether t ontnues to run or s dsrupted (most mportant proess frst) On-lne sheduler (does not preompute shedule) Fxed prortes: same prorty to all os n a task Dynam prortes: dfferent prortes to ndvdual os n eah task task-level dynam prortes o-level fxed prortes MS: ate Monoton Shedulng On-lne Preemptve Prorty-ased th stat prortes Perod T that s the shortest nterval eteen ts arrval tmes Proesses are assgned prortes dependent on length of T, the shorter t s, the hgher the prorty (or the hgher the rate, the hgher the prorty) T < T P > P M algorthm or MS Example Prorty Assgnment Proess Perod Prorty a 0 4 d 0 e
Example P P P Perod (T) 0 0 WET (e) 0 0 Prorty hgh lo medum arrval tme proess t0 P,P,P t P t0 P t40 P t0 P t0 P,P 0 0 0 40 0 0 0 preempton tme Shedulalty Test For n proesses, MS ll guarantee ther shedulalty f the total utlzaton U does not exeed the guarantee level G n * ( /n - ) When test fals: try th the orst ase: assume that all proesses are released smultaneously at tme 0, and then arrve aordng to ther perods hek hether eah proess meets ts deadlne for all releases efore the frst deadlne for the proess th the loest prorty Otherse: hange U y redung (ode optmzaton, faster proessor, ) or nrease T for some proess (possle?) Proess Set A Proess Perod omputatontme Prorty Utlzaton T P U a 0 0.4 40 0 0. 0 0 0. The omned utlzaton s 0.8 (or 8%) Ths s aove the threshold for three proesses (0.8) and, hene, ths proess set fals the utlzaton test
Tmelne for Proess Set A Proess a Proess elease Tme Proess ompleton Tme Deadlne Met Proess ompleton Tme Deadlne Mssed Preempted Exeutng 0 0 0 40 0 0 Tme Proess Set B Proess Perod omputatontme Prorty Utlzaton T P U a 80 0.400 40 0. 4 0. The omned utlzaton s 0. Ths s elo the threshold for three proesses (0.8) and, hene, ths proess set ll meet all ts deadlnes Proess Set Proess Perod omputatontme Prorty Utlzaton T P U a 80 40 0.0 40 0 0. 0. The omned utlzaton s.0 Ths s aove the threshold for three proesses (0.8) ut the proess set ll meet all ts deadlnes
Tmelne for Proess Set Proess a 0 0 0 40 0 0 Tme 0 80 esponse Tme Analyss Here task 's orst-ase response tme,, s alulated frst and then heked (trvally) th ts deadlne D I Where I s the nterferene from hgher prorty tasks alulatng Durng, eah hgher prorty task ll exeute a numer of tmes: Numer of eleases T The elng funton gves the smallest nteger greater than the fratonal numer on hh t ats. So the elng of / s, of / s, and of / s. Total nterferene s gven y: T 4
eponse Tme Equaton hp T % & ) ( Where hp() s the set of tasks th prorty hgher than task Solve y formng a reurrene relatonshp: hp n n T % & ) ( The set of values s monotonally non dereasng When the soluton to the equaton has een found, must not e greater than (e.g. 0 or ) n n,..,...,,, 0 n 0 Proess Set D Proess Perod omputatontme Prorty T P a a 0 4 4 4 0 4
evst: Proess Set Proess Perod omputatontme Prorty esponse tme T P a 80 40 80 40 0 The omned utlzaton s.0 Ths as aove the ullzaton threshold for three proesses (0.8), therefore t faled the test The response tme analyss shos that the proess set ll meet all ts deadlnes TA s neessary and suffent esponse Tme Analyss Is suffent and neessary If the proess set passes the test they ll meet all ther deadlnes; f they fal the test then, at run-tme, a proess ll mss ts deadlne (unless the omputaton tme estmatons themselves turn out to e pessmst) Exat Shedulalty Test for (eah task T ) { I 0; do { } I f ( > d ) return UNSHEDULABLE; I /p k k ; /* k..- */ } hle (I > ) return SHEDULABLE;
Deadlne-Monoton Algorthm (DM) Fxed-prorty Uses relatve deadlnes: the shorter the relatve deadlne, the hgher the prorty M and DM are dental f the relatve deadlne s proportonal to ts perod Otherse DM performs etter n the sense that t an sometmes produe a feasle shedule hen M fals, hle M alays fals hen DM fals Example T T T 0 0 00 0 0 0. 8. T T T 0 0 00 0 0 0. 8.