0% found this document useful (0 votes)
56 views

Unit 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
56 views

Unit 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 75
UNIT IV REAL TIME SYSTEMS SYLLABUS structure of a Real Time System - Estimating program run times - and Scheduling - Fault Tolerance Techniques synchronisation. Task Assignment + Reliability, Evaluation - Clock | 4,1, INTRODUCTION An operating system is an interface between the user and computer system. An “operating system has kernel functions, file management functions and other ‘important functions also. Based on the application, we have different kinds of |operating system. Real time operating system is an operating system specifically | designed for embedded system application. Real time operating system is an operating system with real time task | scheduling, interrupt latency control, synchronization of tasks ‘with IPCs. _ predictable timing and synchronization of the system. Real time operating system | | performs multiple tasks and various functions. | Real-time is a quantitative notion of time. Real-time is measured using af | physical (real) clock. Whenever we quantify time using a physical clock, we deal with real time. An example use of this quantitative notion of time can be observed ‘in a description of an automated chemical plant. Consider this: when the [temperature of the chemical reaction chamber attains a certain predetermined | temperature, say 250° C, the system automatically switches off the heater within a | predetermined time interval, say within 30 milliseconds. In this description of a | part of the behavior of a chemical plant, the time value that was referred to denotes | the readings of some physical clock present in the plant automation system. End od Rea Fg tn coumarins ogi ie (so Ko 8 val Ging) ae cualtative notion of ie and is expressed using event ordering relations before, after, sometimes, eventually, precedes, succeeds, ete. While det" ign goin ay ‘Asm erampl conte he loving it fk vr of Heya software sed to automate the book-keeping activities of a college library, fo boat command ghen by Oe wer des ofa sch Spged by te seve” Ins cal, he ean “we ae command” and “splay of ress” ae lopelly ordered in tems of which el ‘Stow es Bus untae sees ie es ed, a example behavior is devoid of any realtime considerations. We are now position to define what a real-time syster ‘ ls A system is called areal time system, when we need quantitative expr of time (Le realtime) to deseribe the behaviour of the system, ‘A systems classified ds ealime iit is required 10 complet the work on ig consist. Ht does not mean that a syslem must meet some tim deadlines. Typical exaniples of realtime systems include Air Trafic Cons Systems, Networked Mulimedia Systems, Command Conttol Systems, multe systems, viral reality, games, sock masket ee ‘Hard realtime system: If jot must never misses its deadline thea | system is elled hard real-time system. Fora hard real-time system, eve ‘deadline must be ht Ina rel hard real-time system, ifthe sytem fais hit the deadline even once the system i sid t have fled. Ee, fh ‘contol, manufacturing contrat Soft real time system: If some denines can be missed occasoely acceptably with low probability then the system is called sof tin system. In a soft realtime system, even if the system fils to mee ‘deadline one or more than once, the system is sll nat considered to | failed: For example, steaming. audio-video, such as a tempeii| peak Te ems sp sve dog # Te nd ac uc Ssh a 4 thet SY auomatvecectronicseg, NS! Melting ye Tey ae ".emboie ‘only the logical resuits of the come 7 78M behavio, into at ih hese esta pe a gg fg Artonarten cigs rae, computer system has stoped. Based on ya decomposed into a s6t of subsystems je ne time computer sytem andthe human ge OH ns neg 8s cng ren cate ite ga realtime comptes sytem max ject (rte oper) within tne “The instant a which a esas pe 020s fm mera dicts ced is called ay “Ifthe result has utility even ots te dea classified as sof, otherwise i is fom oe cone byt evra leading Me exiples foe han! elaine sitine reservation sens ae so systems. Online transaction systems, realtime systems. —SaLTIME OPERATING See | 42. REAL TIME OPERATING SYSTEM (RTOS) | Operating System isan interface between the wer of wer of computer syste and Jumper hardware. Based on the application ae, we ave iifewnt Lindh of freting system, Because, same operating sytem does ot sats all th Pssiemens in various applica |_Re-Time Operating Systm i pei! purpose opting ys desi fy system, An, RTOS isan OS for response tie contol adel led processes. In RTOS procesing mst he Win define tne casi tem wl fal or cause sor problem. ‘Real-Time Operatn ina timely manner. Programming &® RTOS may have set of Kemel services vith minimum oveend Bm ie och oars a oer ee Gaia tay oom soot nian si 1, Task Management 2, Scheduling 3, Interrupt Servicing 4 Inter process Communication 5 6 4 ‘Memory Menagerent Device Management The following T Enbedded and Real Ting rete oto al ta 1g System has Hibary of fnetions RTOS function is not an easy task, oe) fo ensure that Input EVENS are prog eros can perform molitsk and communicate with more ZAM One pros, time, To obtain these Kinds of tasks, xy. RTOS ech pest “tose mane ina at Se dtc ae and from attached hardware devices Synchronization among Processes fe 4.1 shows various RTOS services. Table 4.1 Vorious RTOS Services SLNo Functions Activities Basic OS Funetions Process Management, Resource ‘Management, Memory Managemen Device Management, UO Deviees Subsystems and Network Devise a) RTOS Main Funevons ne sheng a Lateney Cont Tiers and syn mot Us of {Berets | Timea retin wd dealin in ceney in given tn consis ing “Time Management Apidae ining bof ‘systemandapredictable tasks ramon Predictability Priors al location end pis Inheritance ms ‘Time Slicing ‘Time Slicing fhe jrocencs execution Hard and Softrealstime | Hard Real-Time and Son Reams operability ae [42.1 1YPES OF RTOS. ‘There ae.two types of Real-Time Operating Systems Nard Real-Time Systems Hard real-time means strit adherence to each tak schedule, In had realtime -tems, secondary storage is limited or missing wit ata stored in ROM. Example: Ai traffic control, Nuclear power plant conta es. 2. Soft Real-Time Systems Soft Real-Time means that only the precedents and sequence for te tsk \pertions are defined. Sof real-time systems have Tinted wit than had in ystems, Example: relgcom, Networks, Web Services, riled ae Bl Png IN Es) Saetens ats —__ Ec 2 me = sed oF the MEMOFY allocation ang = a] ee pi mF He OU ol ig ] Eee tae note the al Mie og etter a ere at oF ering rea ol pean | aspect of the | pany Pe Fhe mihi anit fine at iis o gant agg He in, IS odie = reve my me sg processors) and the memory and WOderins, = if shen bite gw Pi ht cn be srs yom ee TE eg poses othe meen eens See Pe | To minr of ween pe pec oy eld inthe CPU: The poate ambeof oes a compiler isn managing thes register, the fewer e vanteronan Satnerd tw oot te CU 0 on bess te 4 This result in reducing the memory aces ne, nd bene hen execution time. The size and organization of te cache wil a ates | ‘memory access time , 8s will the clock rt, Also, many mtn we c@ynamie RAM for theirmain memory. '& To keep the contents ofthese memories we oslo pesoilly ree them; this is done by periodically reading the conn of ech mena location and writing them back, The refi tsk has pty ove the (CPU and ths affects the memory aces tine _[Poeratine system | Te ‘operating system determines such issues as ask scheduling and mea geen, bth of which hve amor impacto te xc ine, eg wi achne secitestre, it detente inter hang on iid Red Pe al = “4d. ANALYSIS OF A SOURCE CODE Telus bop by considering a very simple stretch of code Laie b xe: Labisd tes Lads, ‘This fs stright line code, Once control is tans on wll continue sequentially until the lst statement has be, code with exactly one enty pin fered 10 tHe Fst oF tha statements, excel completed. Sight Tine cod is thus a etch of and exactly one exit pin. “Te toa exceution imei given by % Mone (Ud 1) were Tyce (the time needed To exes Le “The time needed to execute L1 will depend on the code thatthe compile generate fori For example L| could be transated into the following sequnes LIT Get the address ae Liz Londe 13 petthe adress of Lid Load LLS Mulily L16 Sioreintow 4 Te time needed to execute these instructions will depends on the machine architetue, Ifthe machine is very simple, does not we Pipelining, and as oly one UO porto the memory, then the exesaton sm. Tye (Le This assume thatthe machine i time is piven by devoted during that time to just these instruction; for example, that there se o interrupt “However there are wo factors tha could make this bound rather loose. I eae emo mii pein ea Pees bounds on te mia time Pepys tat we have te Fling op, yn Ok i pe oo on «loge tenen we Qc _Jenerbounds onthe numberof lop trations, "| ese bounds may be derived cither from an analysis ofp, QQ and lense oer verve int The ely of tance oes a oops are forbidden in the Euclid real ime programming enguge, had and Q3 are insistions is loop is going to be exceed, we at very last, we need upper and 19, iB then sls elseif B2 then 82, else if BS then 83; atm et ans ite pREPROCESSOR: The pre pocesy Enea and Rel Tone Sc er end if ‘recs ine i pe ee Te decent = TBI) + TSH) + TEMP) 02) an which ofthe conditions BY, B2, BS are yy ie jump 10 the ond of the ithe 3 ‘a where TUMP) is the sme thes 19 Jom a, cons. tion times ‘xceution times. open at ee vase where BI fle but 2 sire the ex = Inthe case whe rps) + 1(82) + 1(82)* TOMP) or + [Sgr ARI Te a re oe wen sil. pes tt Pace ar vember 4 TIME SCHEMA: Ici inepend othe steed and upper bi tee) A appr) a6 the Owe a ‘a then ince there are four eases in all) sh ower and Per in for this eonstrct are given by respectively : HO) and Bagger te language. Tt computes the execution ‘mes of eich black using the exceution time exists computed by th code prediction sea es) & CODE PREDICTION: The coe predisio mone doers this by sing itor 7 e023) the code generated by the pre-processor and usin oe analyze to inelide the influence othe archternae, en SRS Pepccaner Leer 442. ACCOUNTING FOR PIPELINING ears 4 The tational von Neumann model of comptes snes sequent Fomine fof tomer of execution. An instruction i etched, desde, and eect, Oly ater T sy novathat as been done does work begin on the nextiastarton, oy em voy Under such conditions, computing the execution tine of a stnight ie ‘ stretch of code (in the absence of ater) consis, a we have sen -prabove, of adding up the excoution tines ofthe individual insctons ate eden oe ‘$1 -The instruction exeeutiontime is itself computed by simply dig up 2 the imes taken to fete the instuction decode, eth ny operands ht eae : fre required, execute the insrution, and finally, ary ou ny sore on Qpetations that are called for. The time taken for ech ofthese ep can Fig, 43 Schema ofa ining estimation system be obtained by examination ofthe machine architect, Non moder compa oot flow he von New ole | Mom mote smng, which ives the smsecots Sanding Fiz ent fire isons. To ake PENI es, ES nt tobe propre a were fling es ‘MeShine cil looks to the programmer as if it wee fllong the voq| eon model «Much of te compen in deing with pipelined machi fom pendecestecen introns silane) 22° in Sera, Samp, nro 1 ees out 1a Sart pode tht up be can eXEHE, To Shy Tees afcmpiexiy ae cnto Iraehes a interop ‘The enon ofa condonl tach bis © be erase foe i whether the branch wil be taken. Such an evasion od met wt a een ag gE i te ot sin 1 Sine" ssng sents en etree actions. "9 coordinse thei hh te fist se Silay i nena et ig Pons eel handshaking dy. some cpt | Foren neo we peng Sag foreman acess) ihe et i wean tran on eames ‘processor can essing the memory re cea ee etn cecoss so Pet onto emt ee Sean oettonse omens scp main ie wl enter st omens sor Clara et fh 8 oa 2 fares eng ti “The first altemative degrades performance, and so systems usually implemen 4 — ae ees Ce ne olan gua noth : esate Inconel prtetcedinseveons mist te discard and feching mt] P| i a Porton ofthe I, exscution nat ovetapped withthe exsston of any previous instruction (excluding handshake del) nt thar inte reonence fam the comet pin. Inueups are soother source of cGmplexlty. Suppose an interrupt ooeus 0 raters contol to an interap-handing routine, The worst-case exeution Ue ust then ake to account he eterup-handling tne cexecition time of aniston we isu te eth in, Secmnd-ape xeston ine ex xlsig ertn h fine) rea ino xg ner ase. wo STAGE PIPELINE 4 The fist pipeline stage fetches instuctions from the main memory a ites them into pefteh bute. (aaa) Bn Re Pp Ti Number of bytes i the instrstion Bue at the moment, comp. | ‘gy Number of bytes of opcodes fetched during the time 1, is cexecue stage ofthe pipeline, assuming the buffer Is of infinite sie 1h, Time spent in fetching the latest byte of the instruction operation if there is an nsttion fetch ongoing at time Gira Instruetion fete is in progress a f= O- | im Number of CPU eyetes fora memory access (read or write) Inge Size ofthe instevction-eich buffer in byes 1%, Size of instruction / opcode in bytes. 1, Number of dats memory reads required by I, 1, Bxecution time f I, not overlapped with execution of any previo instretion (including handshake delay). Instant at which I, completes vy Namber of data memory writes required by 1, “Anexpression for can be writen by inspection as: fh t=O AGO sinus write an expresion for 2 flows; De Tete testa Pes oe ing an expression for the auxih anal rots cme mt epi ea of opcode, brought into the insnicon bute by te map eh Pring the second slage of the pipeline. In making he compuien hy re ten meet ween BEL if #0) A 60, =O)¥ r,= 0 A6r,#0)) asl Bi? ifC,> Oa0w,>0) “To compute b, we need an expresion fore, and we need to consider the efes ofthe insttion I, fetch and other memory effets, eis easily derived: ecm ntim(r, +n) ‘To.complete the b, divaion, we must consider the following special eases: Cascbl. ¥,>J;-, bytes ofthe J, opcode sil need to be fetched at tie n+ wy, = 0. The execution of I, wil no inter wil ot ite wits opcode fetches, Therarethe loving tea: Case atl. (54,1) h > OAC, fo thy 2 8 ier sme or St se ast ben hed by ne ihr ene nga pede chat ne Teeter vse number of byes of op sa ing excelent tony goo m) st w,> Oped to access memory dig i exci Fat te econd ape of te pipelines nonprenp a am for memory moma, Tew Inibwog howe ae) (hy 10) When the extn Tega ere wo ening itn Le Te, 20 oe oll oe a fecivefech vet fom prtecing ‘Sco et a inteere with he mene snare fie axon Hage hoc Toes, 0. (nef DAC 12 OA) =M—h, 1TH CET) estaton foeh a cane, bt we will preven any ft rete bythe ist sge fr the toned cas 2. Hees Therefore, Case gt. Case. Case 922. 4.43. CACHES Caches are meant to ameliorate the effets on that exists between processor and main memory eycle times. However, th sso impair our bility to obtain good execution time bounds, The time taken by a sccess depends on whether or not the word being accessed sin the cache. It execution of the wide dsr 3 cn as - which is much Ieper tit neo" ry iil 1 Pet We eye sity contents Bre HO easy to = wil ie es. tice thy oe ahi te, eee eee 1080 ccs wi oc is POE io the cach, | to ake rom fo another Heck To dae oe crea arse pe ise in most ate 10 Predict exact what one e| apicee pee ring oe Tas hoe ra vional branches: These deeming te say ‘We don’t know in advance which tranches a ly follow through on every poe bee tion Fah of te 0g tbe ahead we (Of course, one ean always obisin a worse exciion tne ty assuming that every access will result in a cache mis, tat sch 2 estimate is likely to be very inascurte. How wy make reson securat estimates where caches are concerned isa mater for esech. ‘The Strategie memory Alloation for Real-Time (SMART cathe wa developed to get around this difcuty. Asmar cack i tren down ino exclusive panttions and share aca, When a cl task star executing, it is assigned one or more exclusive partons. Kt rests cache accesses to its partitions and tothe shared area ‘Until that task as completed or aborted it as exlasie rights ve it assigned partitions, Even if tis preempted, no oer task can verevit] [22] The coments of is parttions. Such a policy prevents & funy of gy, i ampton and pms ore seats erfomancs sin 44, VIRTUAL MEMORY ul men Is wise to avoid using viral memory whenever posible. The time taken to han tal fr example, en very widely and obaning» 60d Bound on te pa fat nets mont ingore. 4 major source of exeutiontime uncertainty. Thais wy ee 45. TASK ASSIGNMENT AND SCHEDULING ‘Each task has resource requirements. All las requite some execu, time on a processor. Als, a task may requite a certain amouny of memory or acces 10 bis 4 Sometimes, a resource must be exclusively held by a tsk (he thei ‘must have sole possession of i, In other cases, resources | fhonoxchsive. The same physical resource thay be exclusive 9 ‘nonexclusive depending onthe operation to be performed on it Release Time. “The release time of a tsk is ths time at which all the data that are required begin exeeting the task are available. beading ‘The deadline is the time by which the task must complete its execution Te leatine may be hard o sot, depending on the nature ofthe corresponding ask, ‘A task may be classified as (0 Periodic (Sporadic (ud) Aperiogie Pestle Task A task Tis period if itis released periodically, Say every P, seconds| + is alled the period of task T, Eas mt ert pereres a oT Fedor esa git Ta ayaa ask ste task is SPOT jnterval see i is ot pera Peto, by * Put may be invoke. nega ji tasks are charac Sporadic tie by an appr te hey may be invoked er bound on he ate t which ig The sveesive IvOcttion oF porate a east (829048 Sport ask ae someting et iy mss alo called apo, Up. Apeiodic tks 1 Be thos ass which arena, have no upper bound on their invocation rte #4 Which also | pxaslenment/Schedule eer stb ai dose ines and complete belore thir desde eee incion i | unite ak ssl wo bersing npn ay fetes oy be 0) Peomputed (finshed) 0) Dynal onto Seeing) one snug al the tats stat fe fee hi ‘The schedule can be fom | Offline scheduling involves scheduling in advance ofthe operation, wth specifications of when the periodic task willbe run and slots for te sporadiefaperiodic tasks in the event tha thy are involved ate Inonline scheduling, the tasks are scheduled asthe ave inthe syste, ‘Embedded and Rea Tn ime Sh en) “The algorithms sed in online scheduling must Be fast di te, ‘meet thir deadlines is clearly useless. the tik, there are 0 kinds of gorithms 4 To assign priority over the task, the rts such as (@ Static provty algorithm Dynamie priority algorthia Statie Ponty Algorithm State priority algoritam assume mode, Bx: Rate-Monotonie (RM) algoritm, thatthe task priority does not change within Dynamic Prsity Algorithm ‘Dynamie Pity algorithm assume that rority can change with time. ‘Bx: Earliest Deadline First (EDF) algorithm. “The schedule may be preemptive or noapremptve. A schedule is preemptive tusks canbe ineruped by oer tasks (and then resumed) By contrast, once a ak ‘mst bern to completion or unlit ge fa begun in a nonpreempliveschedile blocked vera resource. Preemption allows us the lexi tsk trough to completion once we start executing it. Committing the processor in snonpreemptive schedule can cause anomalies. 145.1. CLASSICAL UNIPROCESSOR SCHEDULING ALGORITHMS. Fig 4.5 shows a miprocessor scheduling is part ofthe process of developing mulirocessor schedule In this section we wll consider tivo venerable algeithns sed for scheduling independent asks ona single processor such as 1. Rate-Monotoic (RM) algorithms 2, Ballest Deane Fest (EDF) algorithms “The goal of these algorithms is to meet all ask deadlines. The folowing assumptions ae made for both the RM and EDF algorithms. ity of not commiting the processor to run a ‘only processing TeaUiemens ar sg Ao. Merce FEGUITETES A neggigie gs, allies ar independent thr ae sumptions srealy simpli the aye pcre a the anayss of RM and EDF "5 memory, UO and other isto an siecaion ‘eal besa sceaion Pesta Decor Foire Fig. 4S. Developing a malipocessor scheide /452..Rate-Monotonle Schéduling Algorithm | The Rate-Monotonie (RM) Scheduling algoritim is one of the most widely ied and used in practice. It is a uniprocessor siti-proity preemptive scheme ent where i is otherwise stated, the following assumptions ae mde in adtion| lessumptions AI to A3, Ad. All tasks in the tak set are patio AS. The relative deadline of a tas is equa ite prod. Babotlalond Roo Te “The peony ofa tach i inversely ret 1 = pete en wah 7 Ty baw Bigber poop tan T,« WehEE Pe Hay preempt lowers tak example For Rate Monotonic Schedstng re pees wake with By = 2.7: Py 10. TH CXECUN tings en 0s ep 20ey= L7Sandl, = O1y= Bly 3. Since cg cteck fe RM shelly of eh ag et nent owing ata eon. SA RM ste i any rao epg M2 | wor Zale perme ? Sl ons ban | I oe tetera | Lm 22 Ae oe Ts PM sched if, < 109 | 2 neo Fak Tris RM schedule et t= mat Batis 1 on \ ste 5150 vcs teat mount of work cared by sks Ty Tao Ty init ing ; moe [Oi al esa rete tine 0 then tak T, wil complete nd pak Ty 6 RM schedulable it be Ra alg tine sah that W (= Gt such 21") | etetes $100 fe Given ant of m proc asks (with PSP

Tyand suppose T; starts execution at Ame ft Toeks Sy Asn 157i intated_ and it peeps T, ong to is higher priority. At time 1,7, locks $- At me 1,7 altempl 19 lock S, bu is blocked because, has finished with it Ty 5 which now inherits the prioity of Ty starts executing ioweve, when atime res o lock Sit eanot do so since has Tock nit Both, and T, are now deadlocked. “There is anaher drawback of priority inheritance. It is possible forthe high Fniorty tsk to be blocked once by every ober tsk executing, on the sam processor. ‘To get around both problems, we define the priority eiling protocol. T| plot cling ofa semaphore i the highest priority of any task that may look Lat PT) denote the prioity of task T and P(S) the priority elling ofthe seman oferta eatin, = late sen Baer ee eet le ei ey eng OUD 8 ae we ay ask 638 al80 be blocked frm eeqng et i corre held by sme other at ya Ca i, hone 1 the priority of T ony cigs gra y ropa Fh ry in a sing, “re pity cling protocol prevents desde et B, be the st ofall ei sections hal can ease te ‘and 1(2 be the time ten for seston to beeen ene mx ted. The, Tw tHocked frat most" ), ‘The highest pron the processor (Le. it is blocked) whene a er seeks 10 ack the semaphoisgurdng «citi secon whichis aeay ey some ther tke Q (in hich case itis nid we ae ‘or when there exists a semaphore $! Hosked by tsk), sk Tsai POcessr.Telngies locked by ory exling eon whose priority ecling or gett than or ql the pty off er uote aera pore tow oaety weer ta oon re i tly ua cmay sua er ‘Suppose. blocks one or mare sks. Then it aber the pity task that it" is cumently. blocking, The operons of pity inheritance and resumption of previous pray rind, Priori ineritanee is transitive, ‘A task Ty can preempt another tsk T, iT, oe ot ol el seotion which T, curently needs and ithe cures ity of rater than that ofthe curetpioity oT Fig, 4.10, Priori cling prea em alin FeSBTD ements wing He rin ling pes 6:2.2. Pamemtn Eatin Denti FZ IE Bigot fs gcsne slong, See TOF sprites io oninte tative is ie extice. EDF in 2 Grate perky Sebo wipers, so Gna spe Sep, ee ech piecing der ‘Soe ade UD) ie lit Se aie et ‘exargie ‘Comite te folowing vt of (asin eave to ween. [Teme | “Fork | Arrival Vine | Execution Time | Absolute Deadline | o w 3 2 3 10 7 fs w as] Tin oly ak wing ran wn vo as er latipes pty an 1 wna Ty ave immcditely Y aives atime 4 vce tT, aives a tne 3; however since dy > a, slower privity Ua fr Fk finish. When T iiss (at time 7). T start (sine at which point ean resume aot a) 11 and must has higher pony dT). run un 1 to completion & EDF ts an opti! wigrocessor Seheduling algorithm, That is, i EF cannot feasibly schedule task se on # uniprovessr, there is 19 ot setedangalgovitin that ean. & Ifa the tks are periodic and have relative deadline equal 1 te pets the test fr tak, Set schedulabity i particulary simple the total ilzation ofthe task set no greater than 1, de ask et ‘be easily schedule on a ingle processor by the EDF algoritun. Scheduling Test for EDF Define U= Ee, 7P.) daar ™ 2H, {dl} and P= LEM (ys Pa Zo wth increased service RIS) a, Mie reward funtion associated with a0 TS skier se given tit Typically the reward function isos fan ib the ote 0 ite 04m tere r(x) is monotonically nondecessog in, : “Te reward sO pt sometime mf tease : if es isnt cued pia point, it produces no useful output. 2s “asks with this evar finction cn be canbe end savings mad ‘and an optional component, | ‘The mandsory portion mus be completed by he deine i be kl eric te optional poon is dane tine permis ‘The epional porn egies ttl of tnes compl. nex se th exeetion ofa ask mse oped yi deed. Identical Linear Reward Functions Fertak ,:the reward function is given by 0 itxsm R(x) = 4 x= m itmers0.+m, 0, ifx>m +0, 04s Oy possible 1 (38) Enbedied ond Real Fro the reward from excong anit of epina work i one mit Agere ssid to be optimal if the reward is maximized subject to all tasks complery their mandatory portions by the task deadline. 7 The tasks T, ... T, have mandatory portions My, bed ee Mand option poy ey = Define M = {Myo My) 0 = (0-0) Te TT) “The opal algorithm for IIS Ii shown in lowing Sau. We re unit of reward for-each unit of the optional portion coimpleted for any tak pict reward fs obtained when the proceor caries out a8 much exseuiay ‘Run the EDF algorithm on the tisk set T to generate a schedule, y ‘this is feasible, ‘An optimal schedule has been found: STOP. ise, go'to step 2. endif [Run the EDF algorithm on the task set M, t0 generate a schedule, this set snot feasible, “Teannot be feasible scheduled: STOP. : Elie, Define a, a8 the fh instant Sq when either the’schedled tsk changes, or the processor becomes le, 1,2 Let k be the total number ofthese instants Define ay a8 when the frst task begins executing i Sq Define x) asthe task that exeoutes in Syn 24 +3} Define L, () atid Ly () 2 the total exeeution — ‘a0 0 3. ‘edit a sek} “go while(0m, #05 Ech task has weight , astocited with it Astine tat he esha Inder in noninereasing order of weighs, 2,2. 2e Th ose -cnsly scheduling such tasks is obvious. ‘Alvays Rum the available tsk with the getest weight ue 1 th ed south mandatory portions ofl the tasks byte respi dein. TH forty algorithm ARIS 2, which is shown in followin fu imbedded ant Real Ti Mel 7 sions of all the asks, ang wera we wane a Se anders ete roaig che ts mt the task set Tis nt schedulable: STOP. che do while 54m se 0'= OU 10. Define 0, to be the prt of seuMi= Mu (0,1 and use IRISH to Find an opin chess, scheduled by IRI peed endo cendit cal As with IRIS, we check to see i ‘mandatory portions. Hat, we tp i & Ite sueeok, we proceed by Roiing II fsa tothe mandatory potions ofthe tasks and he Set of option omtions ua nly to optional portion of ask T if we can feasibly schedule alle 5 aay 1 ith a mandatory tok 45.22.0/1 Reward Functions We asume hoe that fran task / he reward function fs given by 0 ifs sm, +0, | ie) we get no rewan! for exciting the optional portion pataly. IF we ren optional potion to completion, we obsin one uit of reward; tennis We & pothing {fan optional pt is not runt competion i 5 tion in the eu sheds, we @ We continue in man the dealin “phe optimal SIRICEY WOU be 9 omy & TM ible, subject tthe constant ar ns jos must be met, » erin orton of al he mandatory Giforunately, when the eXecution tings Souining an optimal sedate can be sho as ai 2, the pectlem, nnd NPComune selena oy ‘The IRIS3 algorithm is based onthe following pen ‘Therefore, We assign eight acconting tthe in the optional portions and run IIS? "of he duration of] remove its optional portion fom consitaton and eum nn i mer unl each optional portion bss been ei scheduled to completion or dropped ahgether bee eer Run the EDF algorithm onthe et M of mandatory sks FM is not EDF sehedulal Task setT cannot be feasibly scheduled STOP. ele Gow sep 2, endif iis the st of optional ponions Assign, = 1/0, fori = 1.0m Renumber the tasks so that thir weights se in 8 non-sscenting sequence, ie. wp 2w ey Run algorithm IRIS? on a task set composed of the mandstory set M and optional et Oto bin schedule Sp aa Stems ia te previous SECON, We consider a Eablet Ral Tne 5a Fall the optional asks in O are executed to competion in Sp in ks Return Sy and STOP. 1s i tor portions of 20. There a mae re eines an ke pa pe owed intone en by ‘ll. We sume that fray ‘Let fy be the smallest index # such that = Res {@ itosx so, 7 (0s not rum to completion in Sy : 4,10) itzz0,” fa “ he functions f, ae one-one and concave, eno the service that as T, restive "The total amount of service that us Redefine O=O~ (Org) 1 0) Letty the inte |accule S LT ne, D)antr ‘ optimization ogi alee § xj 8. The onininaton problem tecorekaertemerinag nizing Gorosep3. endif ead Fig 412 Algor TRIS ‘ P= Z 4 45.24 Identical Concave Reward Functions rc) 1 tothe constrains that In this case, we consider tasks with identical release times and with mandsion bis Ex = DD, orton fo, We assume tate ead funtion oF, is given by fare Ro = fl, Osx=0, ey ee 0) 1) ~ [yoy ifx= 1 ay 20 tsjsise ce oes eae ee ling Lagrange multiplier. The‘soltion 10 tit pinieaon pace coe oa ry 8 bin po | multipliers. ¥ ° were the functiof is one-to-one and concave . Recall that a function /() oneave iff forall, and 050 flan +[-a}xy) 2 afte) +See) CGeomettialy, this condition can be expressed by saying that, for any to points on concave curve, the stright line joining them must never be above f(D) ~My Isjstsn ol ere. An example of concave functions 1% : ana fenaina | Exy-O-d.y = 0 on : “We will also assume that the functions f(x) are differentiable, and define ms . 43) ete) =a) ds. We wl asume tha theives uncon gf g exis era 320, vy4y=0 ¥, 30 lgystsn «| ere from above equation, 50 and so fom equation () 81660) 5 lajsisn ty) «| 5120, we have ny = 0 and so fom equation) L £6) = 4 Isjsisn C) ‘hie wil happen f the fnctions gare monotonically decreasing and we asun| that they ae. The tasks are numbered in néndeereasing order of thet abso deadlines (1: D, SD, $... sD.) For notational convenience, define Dy 0 Eanbeed ond Rel ine Sp (ed) Let (and 3, ‘enotes values for 50) andy (6 = Vm that sai equations () 10 (6). 4.5.3. TASK ASSIGNMENT ites typially allocate according to some simple eiteion and hope thy that criterion, When checking a alloca ei feasibility wil follow asa side fect of @ easily, we must account for communication cos For example, suppose tat T, < Ty Task T; cannot stat before receiving tek, opt Tati, denotes the completion tine of sk T, and, se time o communist fom , 07, rR hiten tasks T, and T) at allocated to the same pressor, then ¢1» = 0. I they ae nis postive and must Be taken no aso for located to separate processors, hile eeeking for feasibility 4.5.3.2. Utilzation- Balancing Algorithm ‘This algvitim ottempts to balance processor uiization, and proceed by locating the tasks one by one and selecting the least utilized processor. Te gorda is shown a following figure. “This algo tes into account the possibility that we might wish 1 ra mukiple copies of same task simultaneously for fault-tolerance. Tn particu, i fssina r,eopies of tsk T, to separate processor. Let uj and uP denote th izations of processor p, under an optimal elgoridim that minimizes the sum of the squares of the processor utlizations and under the bestfirst algorithm, respectively. Ir, =. ra = rand there are p processors inal itis possible stot Lory yr BON no sig fap (rr itp >> this rato ends to 1.125, whichis agreeably smal eters foreach ask Te do Allocate OOP OF ek ho update the Processor allocation to acesun o a fp ‘tized rocesons easton fi, end do (ober 3s the redundancy be scheduled). the mun HE Of copies of task, that mua Fig, 413. Uitetionbtercing gery Nextt Algorithm for RM Scheduling sao “per isa utlization based llcation bei hat is mean oniuaction with the remem tin conjunction oie sheng cacti assed 0 consis fen procera resources ote han frei mo oss ine: Defite Mo sci placed by thes Tak Tsincasy engin 21s emt secialy be loom, The eS |at sony allocated the tasks ofthat class, | | We allocate tasks one by one to the app ce en ot |schedulability. om esis sete ie | eee we have a set of periodic independent pretmplible asks to be esiped| 1 alroceno consisting of en pce, Tet eis al creo ter tan proceso tines guaran a Tad ol eal Fa tions of the tasks =] “We mow tn ong a sum of te tions oF 1 Sk igng processor so greater than 1, the tsk sets EDF schedulable on that proego eee oblemstucs to making tk sent Wh the pope thu sriat tendon of the sk signed oa procsor doesnot exced |.) ‘Wert ke minimize he ier of processor needed, This sinpaking problem and many slots exist fer solving “Te alot we present here te ist dereasing ago, Sup eat tobe snpned. Prepare sorted Tit L ofthe tasks so tas zane noinereasing ore. This pode o sow tat when he ber of proctor FU i ge,y he fama "Number of pocsessos sed by the fist ft decreasing algorithm “Namber of processors used by optimal algoriim approaches 11/9 ~ 1.22, when 2 large task set is used. In fac, this lini approwched quickly, so that 1.22 is a good measure even for relatively sat ome 15:34. AMyepcoffn Sehedllng MS) Agr ‘Tus fe fe toned ht ss canbe preempted The mo Dine hcg hun s on esinnentedling sein my fen peenpve was Moni offing steung get thes acount no cay of proceing nets ut loo any eget th ak yh {Sakon resources > Por itn, atk may ned be exci ees 0 kl amr rma eda hve ntl oe prt. © MOS wan ofine grin nat we re given in avant x fuk iran tines, execlon tines and edie MOS proceed by bling asco tes ‘Bach node ins re reprsens an iinet and shed ube a he ks, ° seems ee © Bach child of a noag extended by on tn 4 Aleafof this te consi sis ote «pe stile 8 TO AD tt yy an aa ont of 04 PSs chet! Ley se pastincan be esi 5 ls ty teas We tart a the 001 node, which ink having Ben sche one hes ton0 tak having Been sede ie) tea 2) Pree 0 buld he te foe ht poi anode ns developed a flows, (0 ahe rot oft eau —_ 3 Teron Shera ; tt ene age 1 deep cade, Given a node n, we try to extend by one more task 2, We pick up one of the as yet us schedule represented by node n, 3, The augumented schedule is acid aod fn ‘There are two questions that mst be answered, U8 Sede represen by ta nd edule tasks andy to a it he 1) Which tsk do we pik for extending an incomplete scheduler Ans: The Wk tht We ce eet " fa esp se ce shinies te eo : saya fn Task execution time ens © Destine aris stor time $ Laxiyor icihted sum ofany of the above For instance, if H(() = D, , then the next tsk tobe chosen for scheduling will be| HHeaeyetcunscheduled task with the carliest deadline. Embedded and Real Ting ae 2. When do we decide that » node is not worth developing further yay to another node? ny Ans FE nw ma hp asl and develo i Taga "fgg ap —— fat icc Moras 2a Cia PK 15100 FAFEE, We Wl spe g 4 We nly develop a node iit is strony feasible 2, feasibility of modes. Ft oon 4 A node is strongly easibe if feasible sthedle C4 be Lene . eee | festonding-the curent pail schedule with any one of the ans? j.Foeed AUUFSHNE and Bide AB Serre et aged addressing and bidding (rap) ye dure and 5 sed fr tsk sts conser nn cr sing te 8H oe an Ona eaay mien ten paees eae ‘that are leaves can represent a feasible schedule. "s ttweesenners ne tnt en fase enki ay | SP eauinesiap eet eeaS aera cn aeny wif ei facets en se aieeeg airman reer |e will need to check feasibility oF extending the schedule by each of te ‘asyet- unscheduled tasks, As a result, the number of comparisons need los fo FAB elgorithm i sed when proceso, deine jeresares oF He 1 EXECU the tk In that cae nae [cone rroeworin the system. The FAB ler nec Sp Bich oer minis taste ar ine ee ee the mumber of tasks is a is ve evel generate one root-to-lat path is ele y+ oe “These include the Set of cris tasks and Any aon that it may have accepted, 1 mainains a able ofthe spl compan 5 oa apc to processor in the system, a al net yD # me | ‘To reduce the number of comparisons, we ean replace the strong fexsibiy check al cach node by means of 8 myopie procedure as follows. is procedure picks the frt mi ‘The time axis is divided into windows, which ae itenas of fice ‘uration and each processor regulry sens to its collages the aston ofthe next window that is curently fe Since the system is distributed, tis information may acne be completely up to date 8 shopping for a processor on which to fled a task, an ove checks its surplus information and sles a processor ale the Foessed 1 For ach nom leaf level ~ node. {Kony} se-yetsnscheduled tasks 2. Checks o se ithe schedule represented by m can be feasibly exten by each ofthese tasks. act ws mark the ode as hopless and backtrack as before. Others, ‘ve develop children for that node ‘The running time ofthe algorithm depends on K and H, nbd Real Tins rocewor Py hat blevest be ost ikely te ale ose 9, that task by its destin “The RFB (Requests For Bids) c successfully execu ny proceso that can sucessfully exces he Frvceasor Py tating how quickly tan process he ontans the vital statistics ofthe tsk ang re the task t0 send @ bid 0 the fon sk. a a 1 sending processor estimates that there ‘An RFB is only sent ut i th Ha cncugh tine for timely reaponses toi Kalo computes the lates ine at whi foconed processor ean ofload the task onto a bidder without the tak deg being missed his time is given bythe expression “= "Task deadline (current time +time to move the ask + taskexecution ie) the an RFB is sent out 3 ft eecks to soe HH can meet the We ba Sta ‘When processor P, receives an RFB, requirements and sil execute its alteady-scheduled tasks successfully. Fr, si arrive and, how long if wil ake t0 be ei estimates when the new tak wil nrnted o fejected. This time i given by . 7 on = Curent time Hime forbid to be vessived by Py + time taken by P fo make a dession + time taken to transfer the task + time taken by Pt lther guarantee or rejest he tsk ‘Next it figures out the surplus computational time ‘yuries that it erent between gy, and the task deadtine D, This done by first estimating t compottiona time alteady spoken fo inthe interval [yp]. | time alloted to crite ws in [rx D] to run aready-aceapted noneiial sks + me needed in are + fiaction of ecetly accepted bids : time needed in f,,-D] 1 honor pending bids he G8 ie estimates. I'he task worstegee ei jose of Mecevative indeed IT aVERagS-case vals rg mee eh the bids wil ee ask execution time, hen no bid sent uty torts, outa, bid 10 Ps. The bid contains Phe 218K exection ee ne eh atin ong * - Fy mat td ns _ Ay bean review the BS es back tse wh eee ef sw ne ase "erative ean vary with he apt a 0 estimate of fon ih grated oe to proces the ts ch other proceso is most vn Ps computes the estimated arrival (ofthe asks the node Dent 5) and fy) Ly 86 yy VAS contained nh id ened og 1 () Ho computes the following quantity foreach i yy then. tai O~ Sraratas 1) spss) the maximum sch Yale. Then iP ot gn -|getak it ships the task out top, _|asae. The Buday strategy | the boddy strategy attacks the same typeof problem as the FAB algorithm. Sof el Te tasks arrive at the various process af a mle nd ia ital proceso finds ovo es offen sks es ay loaded processors. Te buy tae dis fom te FAB ler Ered ond Realy U— (underloaded) ifQSTy itt, Mulile hardware units may be assigned odo the sme askin ogy ariel compu Ione oor of es unis n how pa + daogenes in he es. Te expt this to datetion. IF ony a minor ofthe wits ae fal and a mijorty of they proce the sme opt, We ean se this majority ret and ths me theefets offal. more than a minoriy ofthe wits disagree fre and ean use other methods, such 25 repeating the computation ser processors, to correct forthe faults. ‘& Conetion and masking are shor-erm measures, They newtalize fet ofthe observed flr 4 Inde second metho, is posible for systems 1 be desiged so tg spares can be switched into replace any ally un 1 Redundancy is expensive. Duplicating or tripling hardware i Tuxury thas only janie inthe most rita! aplicaions. Voting and consensus ‘One way of tsing redundancy isto have multiple unis exseue the sn i and compare thse outputs. I atleast thrce units are involved this compare ca ehoos the majority value a process alled voting and thus mask the effets of me flrs. vo unl re wed the comparison can detect (bu not cores) an exe 4} The designer must deside whether exact or approximae-apreemes i expected betwen funetonng units. - ‘© Approximate agreement may be used in enses where senso = smeasuting the pysieal enviroment © Thow ate tee types of voter, which can function in eases whet approximate agreements eqied 1. The formalized maory wee 2, The generalized K-pluaiy voter and 3. The gescraized median voter sileast we have deste | ca Btn . i software, SUPPOSE at itis reasonable gu 0 2 tio te ey cea om Spuiy.Ta eco MSY wo pn te ECORI AST aes, yp nen em og nye € Pyilf'd(s,y) $e, and Simei 2 Se it aaa frets tenga, Lee tr 2) semester enor xe eae nuratty veer "herd Kul oe vt dn eae a ester rent sy eres te a slong as P, contains atleast K elements oe ’ then tee exist some w« Puch ha \cineraized Median Voter ‘The generalized median voter works by selecting the middle vale. The idle nue i Selected by successively throwing away outlying values enti ely te nile vale is tf. sce Moor 48 a8 follows Let the cups eng vor on be es son ry) 1. Compute dy = d(x) forally €8 fori 4). 2 Let dy, be the maximum such d. Define S= S~ (x,,;)- 11'S contains only on element tht is the uit ofthe ote; else go back to stp Ebel ond Real Fine stati Pairing ges and Stes iO whe "ely tansmitsiesnes mess nove th inert, ‘seen 10 be fay, jae, the IterFize Can checks tikew! 5 the output of the, homes ofall is to hardware processors in pais, ayy Es the some time. nd the itera i | the same way and produce exactly the same ony weg E Monitor and the inerfe wil il simultaneously °° 7 aneour EL poled 2 sc! rele robe that there sno failure ny oft fou conponen te processors the monitors and ihe ine, dell «gogo ts 1 vase we pa sin ant ale, Wen bln! nd ug nt one ata fe bs de aot Redundancy rep Nemo redunncy (NMR) a eh fr ral em teat yang proces ine one and vgn dupe 4 Nie suely od Folowing Fae ses is he N=. Om «atte approaches is psi In deg) te a ve ae tne case produce ouput Indesign) som ig, 420. Stale pring “The pir uns identical sofware using ena inputs a compres output of ech ask. “tate outputs a identical, ‘he pie detects nonidentleal outputs, “ofthe processors inthe pais fly. 4 The procesor that detects this discrepancy the est ofthe system, ths isolating his pair. approach wil work wells lng asthe fterface doesnot ila sors do nt fil identically and around the sine time first i not neces 1 point of fla the pair is functional. IF ether processor ‘hol isan indication that a est on x switches off he inet bth procs 4 The second isan acceptable assumption and the f ‘ccepable. To get around the inerfce beng 8 crite ‘we can introduce an interface monitor. Tree a Worn & we fs ve f—- ° » Fig, 422. Stectareof an NOIR laste (0) v0) ‘ig, 421 Use of monitor Single er

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy