You are on page 1of 21

UNIT - 3 (2 mark) 1.Define Process. Process says the state of the program in execution. 2. What is an operating system?

It gives the way to switch over between processes. 3.What is termed as tas s? !as s are defined as a set of computations or actions that processes on the cpu under the contro" of the schedu"ing erne". #.What is a mu"tirate system? When mu"tip"e rates of computations are fo""owed it is difficu"t to write code fu"fi""ing the timing needs. !he uniform rate that maintains the high speed and "ow speed process to wor at the same rate is ca""ed as a mu"tirate system. $g% Printers &.What is a tas graph? ' co""ection of processes with data dependencies are ca""ed as tas graphs. (.)ive cpu metrics. Initiation time *omp"etion time. +.)ive the formu"a for ca"cu"ating cpu uti"i,ation. If - is the tota" execution time or interva" time. then cpu uti"i,ation is ca"cu"ated as. -/ w!0 t 1.What are the states of a process? 2unning 2eady Waiting 3.write down the function of a ready state. Processes that are ready to run but are not current"y using the processoe are put in the ready state. 14.Define 5chedu"ing 5chedu"ing is defined as the process of se"ection which says that a process has the right to use the processor at the given time. 11.What is 5chedu"ing Po"icy?

It says the way in which the processes are chosen to get promotion from ready to running state. 12.Define hyperperiod. 6yperperiod is defined as the duration of time considered and a"so its "east common mu"tip"e of a"" its processes. 13.What is schedu"abi"ity? It indicates that any execution schedu"e is there for a co""ection of processes in the system7s functiona"ity. 1#.What is schedu"ing overhead? It is defined as the time of execution needed to se"ect the next execution process. 1&.What is meant by context switching? !he actua" process of changing from one tas to another is ca""ed as context switch. 1(.Define priority schedu"ing ' simp"e schedu"er maintains the priority 8ueue of processes that are in the runnab"e state. 1+.what is rate monotonic schedu"ing? 2ate monotonic schedu"ing is an approach that is used to assign tas priority for a pre emptive system. 11.What is critica" instant? It is the situation at which the process or the tas possess highest response time. 13.What is critica" instant ana"ysis? It is used to now the schedu"e of the system.It says that based on the periods given.the priorities of the processes has to be assigned. 24.Define ear"iest dead"ine first schedu"ing. !his type of schedu"ing is another tas priority po"icy that uses the nearest dead"ine as the criterion for assigning tas priority. 21.What is ID* mechanism? It is necessary for a process to get communicate with other process in order to obtain specific app"ication in an operating system. 22.what are the two types of communication? 9"oc ing communication :on 9"oc ing communication. 23.)ive the different sty"es of IP* 5hared ;emory 2

;essage Passing 2#.what is cyc"ostatic schedu"ing? 6ere interva" is the "ength of hyper period 6. <or this interva". a cyc"ostatic schedu"e is separated into e8ua" si,ed time s"ots.

Part B 1.Write about the various scheduli ! "olicies i detail# !his is defined as a process of se"ection which says that a process has the right to use the processor at a given time. 5ome of the schedu"ing po"icies $cheduli ! "olic% ' 5chedu"ing po"icy defines how processes are se"ected for promotion from the ready to running state.$very mu"ti tas ing system imp"ements some type of schedu"ing po"icy. When the schedu"ing po"icy is chosen correct"y. it confirms 2 things. !hey are =a> '"" the timing re8uirements are satisfied by the system. =b> 5ystem strong"y supports cpu horsepower inorder to imp"ement the system7s functiona"ity. $chedulabilit% It indicates any execution schedu"e is there for a co""ection of processes in the system which shou"d fu"fi"" a"" of it7s timing re8uirements. Inorder to now the schedu"abi"ity. it must to bui"d a schedu"e. -ti"i,ation is one of the ey metrics in eva"uating a schedu"e po"icy. 5chedu"ing overhead shou"d a"so be considered. ' schedu"ing po"icy must be examined. <or this purpose. ?uti"i,ation7 can be ta en as a factor. !his cpu uti"i,ation shou"d not be more than 144@. !he cpu uti"i,ation is ta en into account of a"" the possib"e process executions.

<or the periodic processes. hyperperiod is an important criteria. &%"er"eriod It refers the duration of time considered and a"so it is the "east common mu"tip"e of the periods of a"" the processes. 6ere one examp"e is given for eva"uating the uti"i,ation of a co""ection of processes. !here are 3 processes P. A and 2. <or these processes their execution time and period are given in the tab"e.

:ame of process $xecution time Period p A 2 1.4 x "4 2.Bx 14 3.4 x "4 1.4 x 14 ".Bx14 5.0 x "4

'mong these periods given. !he "east common mu"tip"e of period is C*; / 5 x I 4 s. It must to now that the number of times every process executed in one hyperperiod. !hen on"y the cpu uti"i,ation can be computed. 6ere Process P and A are executed & times and process 2 is executed on"y one time. 5o. the uti"i,ation over hyperperiod ?-7 is given as &."x14 D&.2x14 D1.3xI4 E &x143 -/4.3( !his amount of uti"i,ation is "ess than the maximum uti"i,ation of 1.4. F 6igher cpu uti"i,ation can be provided by on"y some of the schedu"ing po"icies. F 5o. the best po"icy is dependent on the needed timing characteristics of the process which are to be schedu"ed. 6ere 2 types of schedu"ing are given !hey are 1. !ime division mu"tip"e access schedu"ing or cyc"ostatic schedu"ing 2. 2ound robin schedu"ing. 1. '%clostatic $cheduli ! ( Time divisio multi"le access scheduli ! In this type of schedu"ing interva" is the "ength of hyperperiod ?67. <or this interva". a cyc"ostatic schedu"e is separated into e8ua" si,ed time s"ots.!hese process are a"ways executed in the same time s"ot. F <actors affecting the uti"i,ation are genera""y G:umber of time s"ots G<raction of time s"ot ta en for usefu" wor .

&

F !his uti"i,ation can be considered as one of the schedu"abi"ity measure. F 5o. that the tota" cpu time of a"" the processes shou"d be "ower than the hyperperiod.

2.)ou d robi scheduli ! F !his type of schedu"ing a"so emp"oys the hyperperiod as an interva". F !he processes are run in the given order. It is represented as

When a process does not have any wor to do. the round robin schedu"er goes to the next process. Cet the 3 processes P. A. 2 6yperperiod is denoted as ?67. When the first hyperperiod. a"" these 3 processes are executed in the given order. During the second hyperperiod. process ?P7 has not executed. 9ecause it does not ho"d any usefu" wor and so the schedu"er switches over to the process ?A7. '"so the "ast time s"ot in hyperperiod is "eft as empty. *m"t% time slots !hese time s"ot are emp"oyed inorder to execute the non periodic tas s without dead"ines. 'dvantage of round robin schedu"ing. F 5imp"e to wor out F )ives enough f"exibi"ity. Use !his type of schedu"ing is used in hardware "i e buses. 5imi"ar to cpu uti"i,ation. schedu"ing orverhead is a"so another important criteria. $cheduli ! overhead It is defined as time of execution needed to se"ect the next execution process. It is counted a"ong with the context switching overhead. )u i ! Periodic Processes Periodic processes are executed at different rates. $very process is considered as a subroutine. !hese subroutines are represented progP= ), prog A= ) etc. !hese programs are executed repeated"y.

whi"e =!rue> H progP = >I progA = >I J It ho"ds 2 difficu"ties. I. !here is no contro" to the rate of process execution. 2. 5ame rate is maintained for a"" the processes execution. !he first difficu"ty is overcomed by proper"y designing the code.!he code has to be written for finding the time of execution in an iteration. 6ere the "oop is constructed with use"ess operations for the purpose of ma ing the execution time e8ua" to the re8uired period. !here are 2 ways to bring the contro" of execution rate. !hey are 1. 9y using timers 2. 9y using counters 1. B% usi ! timers !he "oop execution can be contro""ed by using the timers. :orma""y timer produces periodic interrupts. !he timer7s interrupt hand"er invo es subroutine named ?timerusage7. !his routine runs every process one time after a timer interrupt occurs. Koid timerusage ( ) { progP= >; progA ( ); } 6ere 2 prob"ems are created. !hey are =a> ;a es the *pu7s interrupt system inorder to mas it7s interrupts. 5o that interrupt wi"" not invo ed unti" after the timerusage ( ) returns. '"so the next iteration wi"" begin "ate. =b> ;any timers are re8uired. '"" the timers need to be set at different rates. 5o. it is not possib"e to provide that much of timers easi"y. 2. B% usi ! cou ters Instead of the timers. counters are emp"oyed to divide the counter rate. When process Q executes at 103 rate of process ?P7 the corresponding code can be i""ustrated as 5tatic int progAcount / 4I Koid timerusage = > H progP = >I if =progAcountL / 2> 00 it refers count of the timer interrupts.

00process ?A7 is executed and the count is +

a"so reset progA = >I progAcount/ 4I J $"se progQcountDDI 00 Increment the count va"ue. J It gives a so"ution to run the process at rates which are simp"e mu"tip"es of each other. 2) What is mea t b% 'o te+t $,itchi ! a d 'o o"erative multitaski !# *+"lai its mecha ismi detail. !he context switch is a mechanism for moving the cpu from one executing process to another.!he context switch must be a bug free.When a context switch is performed. the current tas is interrupted.'"so the processor7s registers are saved in a specia" tab"e for that particu"ar tas . !he tas is p"aced bac on the ?ready7 "ist to await another time s"ice.5pecia" tab"es often ca""ed tas contro" b"oc s stores a"" the information. the system re8uires about the tas . $g% F ;emory usage F Priority "eve" F $rror hand"ing !as ' execution !as 9 execution !as * execution !as D execution

<or the context switching. any cG"eve" concepts are not used. Instead the assemb"y "anguage is emp"oyed to F 5ave and restore the registers F -sing the registers from any process. 'o te+t It is defined as a co""ection of registers which says about a process. 'o te+t s,itchi ! !he process of switching from one process7s register set to other set is termed as context switching. 'o- o"erative -ultitaski ! In *oG operative ;u"titas ing system. one process gives up the *P- to another process vo"untari"y. !his vo"untarism may introduce some bugs. 5o. a context switch is imp"emented "i e a procedure ca"". but it is not a standard procedure ca"" because it does not return to the ca""er immediate"y. $ach process contains ca""s to context switch function switch=>.It copies the state of another process. When that process ma es its own ca"" to switch=> the system goes bac and executes the origina" process or a yet another 1

process. ' schedu"er determines the process to be executed next. !he schedu"er first saves the state of the process that ca""ed the schedu"er. then determines which process to ca"" next. !he process wi"" continue to execute unti" it vo"untari"y turns over the contro" to another process. !he process states are stored in the process activation records in main memory.

Preem"tive -ultitaski ! 9y using interrupts.context switching is done for preemptive mu"titas ing.Ci e procedure ca"" .interrupt mechanism saves the state and then invisib"y returns its contro" to an executing program.Interrupts a"so force the cpu to transfer contro" to the operating system.It a""ows the cpu to a""ocate time more efficient"y between mu"tip"e processes with dead"ines.!he !imer generates periodic interrupts to cpu.!he interrupt hand"er ca"" the operating system. which saves previous process7s state in activation record. se"ects the next process to execute and switches the context to that process.

3) .ddress the various "riorit% scheduli ! "olicies i detail#


$'&*/U0IN1 P20I'I*$ ' 5chedu"ing po"icy defines how processes are se"ected for promotion from the ready to running state. When mu"tip"e processes are imp"emented on a sing"e genera" purpose processor. the manner in which these processes are executed on a sing"e shared processor p"ays an important ro"e in meeting each process7s timing re8uirements. !his tas of deciding when and for how "ong a processor executes a particu"ar process is nown as process schedu"ing. Priorit% scheduli ! ' simp"e schedu"er maintains a priority 8ueue of processes that are in the runnab"e state. When the schedu"er is ready to se"ect a new process for execution. it simp"y se"ects the cess with highest priority for execution. When a b"oc ed process becomes runnab"e. it is added to the priority 8ueue of the schedu"er to be se"ected for execution at some "ater point. When mu"tip"e processes have e8ua" priority the schedu"er uses a first come first serve basis to se"ect among the processes with e8ua" priorities. When non preemptive schedu"ing is being used. this form of schedu"ing is ca""ed priority schedu"ing. !o assign priorities. the possib"e ways are 1. 5tatic priorities 2. Dynamic priorities. 1. $tatic "riorities 5tatic means constant. 5o that these type of priorities cannot be modified at the time of process execution. 3

2. /% amic "riorities Dynamic means changeab"e. 5o that these type of priorities can be a"tered at the time of process execution. )ate -o oto ic $cheduli ! ()-$) Introduced by Ciu and Cay"and.)ate mo oto ic scheduli ! is an approach that is used to assign tas priority for a preemptive system. It assumes that tas priorities are fixed for a given set of tas s and are not dynamica""y changed during process execution. !he ey po"icy within 2;5 is that tas s with shorter execution periods are given the highest priority within the system. F !his is the first schedu"ing po"icy deve"oped for rea" time systems. F It is used we"". F !his comes under a static scheduli ! type. !hat means this assigns fixed priorities to schedu"e the processes. )ate -o oto ic . al%sis =2;'> !his theory enhances a simp"e mode" of the system. 1. '"" the given processes run periodica""y on a sing"e *P2. It ignores the context switching time. 3. :o Data dependencies are maintained in between the processes. #. $xecution time of a process is *onstant. &. '"" the dead"ines are at the ends of their periods. (. <or the execution. it se"ects the highest priority ready process. $g% Process Period ' 9 * D $ < 25ms 5Bms "2ms Priority 5 3 (

"BBms I #Bms +&ms # 2 14

In rate monotonic schedu"ing. processes are assigned priorities such that those with shorter periods are given higher priorities. We have given an examp"e of rate monotonic priority assignment here. !here are six processes. "abe"ed ' through < with the corresponding periods given in the next co"umn. !he priorities are assigned to the process with the "argest period ?D7. the sma""est priority which is 1. !hen the next process is assigned with the "argest period <. because the next sma""est priority is two. In the simi"ar way. a"" the processes are executed. ' set of processes is given here Process $xecution time Period P A 2 1 2 3 3 ( 12

6ere. the processes P has highest priority A has midd"e priority 2 has "owest priority ' time "ine is constructed in order to now the interactions between the periods. !his time "ine is e8ua" to the "ength of hyper period. 6ere the hyper period is 12. !ime "ine construction of processes. 't the time ,ero. a"" periods get started. . Process ?P7s data reaches the "ine first. 9ecause it has highest priority. 'fter one time unit. process ?P7 comp"etes and then goes out of the ready state unti" the start of it7s next period. 't time 1. ?A7 begins it7s execution. 9ecause it is the next highest priority process. Process ?P77s next iteration begins at the time # at which point it interrupts ?27. !he ?27 process gets another time unit of execution between the second iterations of P and A. 9ut ?27 wi"" not be comp"eted unti" after the third iteration of process ?P7. 11

)enera""y the 2;'7s priority assignment wi"" be optima". !his is imp"emented by using the critica" instant ana"ysis. !wo metrics are there to consider. !hey are 1. 2esponse time 2. *ritica" instant )es"o se time It is the time at which the process finishes. 'ritical i sta t It is the situation in which the process or tas posseses highest or "argest response time. !his event happens when F ' process is ready to execute. F 6igher priority processes are a"so ready to run.When the highest priority process is in the waiting state. the response time of a process wi"" go down. 'ritical I sta t . al%sis It is used to now about the schedu"e of a system. It says that .based on the periods given. the priorities to the processes has to be assigned.

/isadva ta!e !his wi"" not entertain to emp"oy the 144@ of avai"ab"e cpu cyc"es for a system. <or ?n7 tas s. the cpu uti"i,ation is given as Where . indicates time of cpu when running the tas ?a7

<or a co""ection of 2 tas s in the 2;5 schedu"ing. the uti"i,ation wi"" be not maximum !hen. Br it is said that the cpu wi"" sit simp"y without doing anything for at"east 1+@ of time. !his is because of the priorities which are assigned statica""y. If the no. of tas s are m. a"ong with constant priorities then the cpu uti"i,ation is

Im"leme ti ! the )-$ It is easy to write code for the rate monotonic schedu"ing. !his code actua""y says how the 2;5 schedu"er executes at the time of B57s timer 12

interrupt . It is given as Active_R processescollection !"R#$%&&%&'; *n, contents store, -*se, on priorit+ .oi, R*te/ono (int curr) { int *; processescollecrion curr'. &t*te1 R%A23; (( processes collection re)ers *n *rr*+

(( curr in,ic*tes currentl+ e0ecuting process (()or 4no5ing 56ic6 processes *re re*,+ to run

)or (* 10; *7!"R#$%&&%&; *88) i)(processescollection *'.st*te // R%A23) ((m*4ing t6e process to run { "rocessescollection *'.st*te 11 %!%$9:%; -re*4; } } F !his considers the co""ection of processes based on their priority. F !hen it chooses the process which is having the highest priority inorder to execute. F It is better to arrange the processes according to the priority before starting to run. run 9ecause here the priorities are assigned statica""y. 5o that it wi"" not be changed when choosing the processes to run. 5taI F If do so. the schedu"er ho"ds an asymptotic comp"exity. It is given as o=n> Where n refers the tota" number of processes in the system. It a"so maintains "ow actua" execution time. !his "ow actua" execution time reduces .Discrepencies inbetween the ,ero context switch assumption of 2;' and the actua" execution of an 2;5 system. *arliest /eadli e 4irst $cheduli ! $D< is a dynamic priority scheme.G it changes the process priorities during execution based on initiation times. It assigns priorities in order of dead"ine !his type of schedu"ing is another tas priority po"icy that uses the nearest dead"ine as the criterion for assigning the tas highest priority. )iven a set of tas s. the one which the nearest dead"ine is given the highest priority. 'nd "owest priority is given to one whose dead"ine "ies far away.!he priorities must be 13

reca"cu"ated at every comp"etion of the process. !his means that the schedu"er or designer must now when these dead"ines are to ta e p"ace. !rac ing and getting this information in the first p"ace can be difficu"t and this is often the reason behind why the dead"ine schedu"ing is often a second choice compared to 2;5. $g% "roces s G H ; = ? A Perio d 17ms 5Oms <2ms l#ms l@#ms <2ms Priorit y 5 2 < > A @

)enera""y the dead"ine of a process is defined as the time before which a process must run to comp"etion. In this examp"e. if a process has a dead"ine of 2Bms than it must comp"ete 2Bms after it starts. !he actua" execution time of a process is e8ua" or "ess than it7s dead"ine. 6ere process ?g7 is getting its priority by using the dead"ine. !ota""y six processes are there. "abe"ed ) through C with the corresponding dead"ine is given in the next co"umn. !he priorities are assigned to the process with the "argest dead"ine . the sma""est priority is this. !hen the next process which is having the "argest period is the next sma""est priority. It is 2. In simi"ar way. a"" the processes are assigned to it7s own priority and according to this the process are executed.When the cpu uti"i,ation is "ess than one. it is possib"e to get a better schedu"e. 'n */4 system wi"" execute at 144@ capacity before it "osses a dead"ine. Im"leme ti ! the */4 1#

It is hard to imp"ement the ear"iest dead"ine first schedu"ing. !he difficu"ty is in maintaining the sorted processes based on the time to dead"ine. 9ecause it cannot be arranged prior to the execution due to the changes in times to the dead"ine. Instead a binary tree is constructed to manage the changes in a sorted array processes. F !he arranged records are maintained at the end of this binary tree. F '"so changes are made in the sorted "ist. F 9y app"ying tree manipu"ation techni8ues. the records are ;oved to it7s new p"ace in arranged "ist by removing it from the G'dded again in the tree. F In the sorted order. the processes priorities are updated. !o update process priorities. "in ed "ist pointers are used to move the records in dead"ine order. Dynamic sorting gives difficu"ty in the schedu"ing process. !ota""y B="og n> steps are needed in order to update the sorted "ist.!he ear"iest dead"ine first schedu"ing code can be written as 2ecordMprocessesI 00 it refers a "in ed "ist Dead"ineNtreeMdead"ineI 00data structure to arrange the processes Koid end Ndead"ine=2ecordMexpired> H removed =expired>I 00 de"eting from the sorted "ist add =expired. expired E dead"ine>I 00 inserting into a new dead"ine J Koid main =int curr> H int aI process E state / 2$'DOI for =a"in / processes 5 a"in P / :u""I a"in / a"in GGG G next dead"ine> 00 to now the process which starts to run If =processes E.state / / 2$'DO> 00 prepare it as a running process H processes E state / / $Q$*-!$I brea I J J *omparison between 2;5 and $D< $. No. */4 )-$ I. 2. 'dv% It is easy to assure that a"" dead"ines wi"" be satisfied. It gets higher cpu uti"i,ation. It is hard to find the

Disadv% it gets "ower cpu uti"i,ation.

1&

over"oad.

In some of the app"ications. the processes can "oose their dead"ines. $g% ' set top box for video decoding. !his is not a safety critica" app"ication. 6ere the occasiona" disp"ay artifacts generated by "eaving the dead"ines can be agreed in some mar ets.When a co""ection or processes are unschedu"ab"e and there it must to assure that the processes wi"" definite"y fu"fi"" their dead"ines. then we can fo""ow 3 ways. !hey are 1. -se a faster *pu 2. !o imp"y "ess time for execution. processes are again designed. 3.5pecification can be written again inorder to modify the dead"ines.

Priorit% I versio It is a"so possib"e to get a condition ca""ed priority inversion where a "ower tas can continue running despite of there being a higher priority tas active and waiting to attempt. !his can occur if the higher priority tas is in some way b"oc ed by the "ower priority tas through it having to wait unti" a message is processed. !he genera" method used to dea" with priority inversion is to promote the priority of any process when it re8uests a resource from the B5. ;any methods are there to manage the priority swapping process.

3) Write about INT*) P)2'*$$ '2--UNI'.TI2N. I troductio It is necessary for a ?process to get communication with other process7 in order to attain a specific app"ication in an operating system. !he communication can be carried out with or in between the process by either b"oc ing or nonG b"oc ing. =a> Blocki ! commu icatio In b"oc ing communication the ?process initia""y is to be in waiting state7 unti" it gets a response. (b) No -blocki ! communication In :on b"oc ing communication the ?process can continue without waiting7. Different sty"es of inter process communication !here are 2 ways. !hey are 1(

=a> 5hared memory =b> ;essage passing $hared -emor% !he two maRor parts of this communication are G*PGI0B Device !hese 2 device can be connected through a shared memory "ocation. $hared -emor% 0ocatio =1> In *P-. the software is provided in order to understand the address of shared memory "ocation. =2> In the I0B device. the shared memory "ocation is p"aced into it7s register. )ead a d Write 2"eratio !hese operations are encapsu"ated in a procedura" interface. <rom the shared memory "ocation. I0B device reads the data. 9efore that it shou"d be written into that "ocation by the *P-. !he f"ag is used to say the cpu when the data from the I0B device is ready. It has 2 va"ues !hey are 1 for indicating the ready 4 for indicating not ready. !here is a chance of critica" timing race. 5o that the microprocessor shou"d support an atomic test and set operation. Test a d $et 2"eratio It reads a "ocation and then sets it to a particu"ar va"ue. !his returns the resu"t of the text. When a "ocation was a"ready set then the additiona" set has no effect but the set instruction returns a fa"se resu"t. If the "ocation was not set then the instruction returns true and the "ocation is in the fact set. !he bus supports this as an atomic operation that cannot be interrupted. !o imp"ement the semaphore. a test and set can be used.

$ema"hore It is a "anguage "eve" synchroni,ation construct. If a memory needs to be used for a process then it uses the semaphore in order to assure that no other process is active"y using it. !wo semaphore names are P=> K=> P = > G It is used to get the access to the protected memory. K = > G !his is emp"oyed to re"ease the a""otted memory. In a program. it is used in such a way that voi,%0( ) { GGGGGG 1+

GGGGG GGGG P= >I GGGGGG GGGGGG GGGGGG K= >I GGGGGGG GGGGG GGGGGGG J P ( ) o"eratio In the P( > operation. a test and set is used repeated"y for the purpose of chec ing a "ocation which eeps a "oc on the memory b"oc . It sets the "oc . 6 ( ) o"eratio !his resets the "oc provided so that other processes can uti"i,e the me region -essa!e "assi ! 6ere every communicating entity eeps it7s own message in the send0receive unit. !he message is not stored on the communication "in .Instead it eeps at the end points of senders and receivers. 6ere the pac ets of datas are sent among the devices. !he message passing is actua""y an efficient way of communication in many 1 bit mictocontro""ers. ;essage passing communication

$i! als In -:IQ. this way of communication is used.it is simp"e because it does not pass the data beyond the existence of the signa" itse"f. !his is fu""y a software creation. ' signa" is generated by a process and transmitter. 'nother process by the operating system. ' -;C signa" is a genera"i,ation of the -:IQ signa". ' -;C signa" is an obRect 6ere the sigbehavior ( ) is responsib"e for throwing the signa" as informed by SS send LL !he signa" obRect is indicated by the SSsigna"LL stereotype.

11

&>Discuss the various P$2<B2;':*$ I55-$5 in detai" giving an estimation mode"? If we want to now the performance of a rea" system which runs processes then the schedu"ing po"icy wi"" not he"p us.5o. when ana"y,ing the schedu"ing po"icies. it must to consider some assumptions. !hey are =a> Tero time context switch assumption =b> 'ssumption the execution time =c> *omputation of worst case and best case items. =a> 7ero time context switch assumption It is assumed that context switches are in need of ,ero time.When comparing the context switch time with process execution time. if it is "esser means then context switch time can be avoided. 9ecause the context switch time gives some sort of de"ay in some cases. =b> .ssum"tio the e+ecutio time $xecution of a process at a time is assumed. )enera""y the program time is not a sing"e number. !his can a"so bounded with worst case and best case execution times =c> 'om"utatio o8 ,orst case a d best case items !he worst case and best case times ca"cu"ation is made separate"y. 9ut both can be communicated in the cache. !he context switching can be demonstrated effective"y. It wi"" not affect the performance.9ut the context switching "eads the system to "oose it7s dead"ine. !his examp"e i""ustrates the schedu"ing and context switching overhead <or a co""ection of processes. the execution time and dead"ine are given as Process Name Time o8 e+ecutio ' 9 3 3 /eadli e & 14

It is possib"e to provide a schedu"e after assuming the ,ero context switch time. !his schedu"e is provided to satisfy a"" the dead"ines for a se8uence of data arriva"s. 5uppose if the tota" time to start a process is ta en by considering both context switching and schedu"ing po"icy eva"uation then !ota" time to start a process is / 1 time unit 'ccording to this. the above given schedu"e is not feasib"e. Inorder to run 1 period of 9 and 2 periods of '. 13

2verhead It is the big fraction of G Process execution time G Periods In many cases. a simp"e rea" time schedu"er ta es more overhead.5uppose if the overhead time is sma"" than the tas periods. then context switch time is considered as ,ero.When a"" the dead"ines are satisfiyng the non ,ero context switching time. it needs to chec a"" the schedu"es of the processes and inc"uding the context switch time at every time of process initiation. ;oreover ho"ding an average number of context switches per process and ca"cu"ation of *P- uti"i,ation both gives the system c"oseness with the *Pcapacity. Process execution time It has to be ept as constant !he run time can be affected by Data dependent behavior *aching effects When ca"cu"ating the worst case execution time. if the run time is shorter then it refers unused *P- time. 'achi ! 9asica""y the processes do not interact. 9ut cache ma es one execution of a program depends on the time of the other. 5o. most of the systems ho"d an assumption "i e there is no cache present. even it is used. It is done because the system architects "ac too"s that a""ow them to ana"y,e effect of caching. 9y this assumption. overdesigned hardware is obtained. It gives "arge amount of computationa" power. G !he we"" designed cache "eads better performance to a program. G ' proper"y si,ed cache can permit a microprocessor to execute a co""ection of processes fast"y. In order to compute the performance of many processes which use a cache . Ci and wo"f prepared a mode". ' model 8or "er8orma ce estimatio In this mode". some processes are a""owed to do reservations in the cache. 2emaining processes are ept to share the cache. !he cache partitions are norma""y prefered for performance critica" processes. 9ecause cache reservations are wastefu" of "imited cache space. !he performance considers both G $xecution time G 5tate of the cache 9y using a binary variab"e. every process in the shared section of cache is represented. Presence of a process is denoted as I and absence of a process is given as ?47 in the cache. '"so. every process can be sp"itted based on 3 types of timings. !hey are 24

I. $xecution time by assuming no caching 2. $xecution time with typica" caching 3. $xecution time with a"" code a"ways resident in the cache. !he a"ways resident time is used to determine a "ower bound on the re8uired schedu"e time. When providing a schedu"e. it must to "oo over the cache state to now whether the no cache or typica" caching execution time shou"d be used. !he cache state is updated when it is re8uired for some other processes. 5o. the cache management increases the *P- uti"i,ation. !his examp"e says the effects of schedu"ing on the cache. ' system maintains 3 processes named '. 9 and *. $very process ta es ha"f of the cache to use. 5o. at a time it is possib"e for on"y 2 processes to be in the cache. $chedule 1 !his schedu"e is given with he"p of "east recent"y used cache rep"acement po"icy on a process by process basis. During the first iteration. the cache is fi""ed. !here is competition of a"" processes in the next iterations. !his says that a process is never in the cache when it starts to execute. 5o a"ways the worst case execution time is used. $chedule 2 !his schedu"e gives ha"f of the cache to process '. so that remaining ha"f cache wi"" be in competition between processes 9 and *. 6ere the process ?'7 is a"ways ready. 9ut processes ?97 and ?*7 are in competition with each other. 5o. average case execution time is ta en for process '. this provides some spare *Ptime. !his *P- time can be ta en to use for the additiona" operations.

21

You might also like