OS MATERIAL-part-2

You might also like

Download as pdf
Download as pdf
You are on page 1of 33
Nater_process commuyucations :- [IP e] pYocess communications : Processes executing concunently un dhe operating System may be erther tnelepenclent Processes 0 evoperating piocesses. ® process \'s tndependlenh IP A cannot affect or be fected by dhe athor processes executing tn dha system. Any process dhe does not share alata with any ethor provess ts de ent. ae pioess t's cooperating UP vb can afRet oF be affected by dhe other provesses executing in dha system. any process fe shares data with othe Processes (8 a cooperating process. eason for process. cooperation: Several useis mely be interested in dhe Same piece of infimation, we must be provide an Cavionment bo allow coneunent acess to such information. ©) computation _speeelups- 3P we want to patticular bask to un fastey, we must brea 14 into subbasks each of ehich will be Cxeauting dn Parallel evith dhe ethers. © moduler Wwe may want to eonshucl dhe system ih a Moduler fashion, aLiviching dhe system function into sepenabe Processes 01 dhnead. AD eonvertienca = An Uebuidual uses MAY wollk en many bask at the same time. egi- user may ecliting Ustensing to musi'e, and enmpiling in parallel. | Cooperalitg process teguites art inter proves leormmuni cation Circ} mechanism ghol will allow dhon to exchange ota ancl infomation. Thore aie kwo ways bo represent tho pater process commurtications. | & shore memory ere aa passing | a shoreel momoyy reptuives communicating processes to establish a region oP shared memory. ¥ Ganavally dha eperating system to prevent one process From auessing another processes mamory. % Shonecl memory reguires dhat two oy more Processes agree to remove chi restrichon. x They can exchange information by Yeading and | writing data tn shoveol areas. The = proclucei Consumot problem Is dhe common Poracligm fer enoperating processes. 9 producer process produce Inrmation dhat Us consumo by dhe consumer process . eq:- | isa compiler may produce assembly erde dhat is Consumecl by dha assembler. * The assemble may produm objeck modules drat \s consumed by dho Loader. one solution to dhe producer consumer problem 1's ho shone momoyy. To allow prodiner ancl consumer Processes to yun eonumently, we must have available a bufey of lems dhat canbe Fite by the proauer ancl empliel by ley dhe consumer. Tus buffs will yeside tn a region of hmemoty dhot vs shovect by produwor and eonsumot prowess | __ process A | gue 7L_shoveel_mamory | i ects |___process B z | | Massage guous \ ‘ slo mn | bemel kernel A produces can procluwe ena tem ewhule dhe [Consurner ts Consuming @nothot \tem. must be Syndmtonized, so dhat gho ensure an ttem dhat has nob yet Te produai ancl consumer Consumer loa nol by bo on been procluceal. | Two ‘types eP buPRas uecl un thus types ‘ef shoved Tomory concpts. | © bousdedt buffer: at is a Feet buff sre. an dhs bounces buf dhe eonsumey muni ward ‘Phe but Rr es emply, | anol dho Producer must walt 1P dhe bufey cs Fat. ® vnbounctect bu Fr. Tre unbounded buf Rr plaws no Practical Nina} on the si of dha bufley. The consumer may have to waik for row Teems but dhe prootutey con always Vrockue now ‘tems. me unde Ry Produwt process us udtule Cerue> leh tetnye Buffer siz) == out) ‘do nothing .»/ but cr = noxt- procluteet. m= Cint)z BurreR_size The —shareot buffer 0 tmplestantat as a eneatar lari with two Uagica Poinbens im > points Yo dho woal free position in buf ols poin Jo dhe (act fu position in dho baler, (n== out means buff ts emply (Cenardy Burren. size)=-out means bufley cs Pull, Me ¢orle Ry Constimon process vs, ‘hem theen nenb ‘eonsameel; ee brue) wlule Gin== out) Toxt_ consumed =' buffer Cout3 ; Out = Cout+i)% BUFFER. SIZE 5 J Ihessege pasting systems The Functions oP dhe massage fpasyig system ts & allow prowsses to communicate with ena another ewithout. shoving Yhe same eddiess space. oF prowsses Panad @ want to eommunicabe ‘|thoy senol messager to and yevetve messages ffom each otter A eommuncation Unk must ecust between chem. dn generally dee wep dhs menage pasring Systems can be ‘mpleonted. & Naming x Syncmoniration & Buffering Naming: Processes that want to communicabe must have a way te rer lo each Other. Toy can be erthor clirect of undiyech ‘Communications. | & cliyeck communications: i an deck communications each process dhat wanls ib Communicate musk explicitly nama the yecipient 1 sender of ‘the communications. | Sena Cp,messoge) —> send a message to process P. Receive (a,mossage) — > Receive a message fiom process a. | Ts Scheme exhibits symmetry addvessing, that is ‘both dhe sender Process and yeceiver process must name he ‘otter to communicate. | On asymmhy ca acldiessing enly dhe sender |nomes dho Yecipient, the reupient is nob yeguived to name ite sendet.dn dri schame Send) 4 yeueretd Piinitiver ate, Send Cp, messege) —> Send a message to process P. yeceive Cid, message)—> Receive a message fiom any process. * Andtitect _eommunieations:- On cholitect Communicahons dhe messages ate bet tecteved Ffom mail boxes ot ports. A mail box can be veweel abstractly as an Object cht> which messages can be Placeal by processes and Rim whieh messages can be removed, Sendlca, message) > Senol a message bo mai) box 4. Recdeve (a message) —> receive a rasege ffom mail box 4. xy Une ts establisheal belween a parr of processes both dhe mombeis of dha petit have @ only Ne shaveot mou box x A Link may be associakecl wlth mote Yhan Jeo precess Synelnonizatons Communication belween — processes takes place Antough calls to gend¢> and yeceivecd premitives. messages ipassing may be either blocising_o1 non blocking also called as synchronous anal asynchronous. The sering process's blockeal until the massage Us received by the receiving process e1 by the mail box. Non blocking _sene:: Me sending process sends dhe massage and Yesumes dho eperations. 3) blocking Yecelve :~ Tha yeceiver blocks until a message t's available. ) non blocking receive: the veceiver ~vebrives elthor a valid massage : or null. Buffering: whether eommunicetions 1's Giitect or ndiveck Messages exchangeal &y _eommunicatin esicle : 09" processes yesiole ina bempora YY queue. Basically such : Gueun ean , Hiree ways. 2 "mplementeel 415 | zero capoctty | & Bouncledl capauity | & Unboundedl capacity exo. saacity | The guewe has maximum length ze. thus the | Link counnot have ary messages waiting init. dn Yu's case dro sender must block cunt) dhe teciplent | Teceives dhe message. Boundled copay: The queue hos Finite length». thus atmost 0 massages can teside init. JF dha quaus Vs nob Pat when a new mossage vs_sent, tre lather is Place in tha queue ancl dhe sender can continue execution without waiting. TP dhe ink ‘5 Full dhe sender must block Until Spaw is avaliable in tho queue. Unboundesl capacity: Tre quaue har polentially inPiube length» dhus any yumber oP mossages can wall init. The Sencler never blocks. \schodluting 1 _—Cibevla:- 7 OiFRront cru schoduling algorithms have oLiffirenk properties, anol the choia of tho perticalar agora fnowy faver on class of” processes vat anothey. Pv scheduling eleals with dhe problem of teething whieh of dhe processes tn dhe. yeady quaus ‘5 to be alllocabecl to dho CPU. The criberia are, ¥ PU Utlizahon Tmough put ® Tuynavound time % waiting Hme & Response tine x we Wwantio beep the cPu as busy as possible. ¥ cpu ulibrahen can yange fiom © to t00 percent. % In veal System, the ange fom Ho pereent to loo percent. [Thoughput - 4 Ont meosure ef work 1s dhe number oP \Movesses dhat are Complebeol per time unit Vs called as Hnoughput » Ry Long Processes, dhia yabe on per ten: ed process & By short Hansactions, 1h mauy be ten Process pet second - (Cumarounel time: # The important crikerion Is how long ib bakes bo execube the process. % Tre interval from dhe time of submission of a proves: to dhe timo of completion 13 the Jusnatouncl Hime. * Tum atouncl te 's the sam of she periods spent waiting bo get Lito memory, waating—cn- “veg: waiting to dha yeady guaus, executing on the ery and asing To. jpeutting ti a The amount ef Hm, dhat a Process Spends weuiting th dho xeady queue. x waiting time 1s the gum of dhe periods pent waiting 'n dhe yeady quaus. ® The cpu scheeluibing algorithm elves not affect the amount ef dime oluring which a process execubes. Response Times m Response time is dha amount of Hmo Ib kakes bo stavk yesponeling. » But not the Hime dhot i bakes to output ghat Yespon se. — schaclubing Algowithms whenever dhe Cpo becontes idle dha epetaling Bystem must select one OP dhe processes tn dhe easly gusue be executed: Te selection process ts carried out by) dhe Short term seheetulet o1 cpu sehocluler. The CPU scheduling elecisions may tuke plaw ludet dhe folloewing four cieum stances. \. phen @ process swikches fron dhe Tumning state bo dha wasting babe. & when @ process switches from dhe yunning Stabe bo “eadly sbabe Can Intenupt eccurs). 3. unhen @ recess switches fiom waiting stake to ready Sbabe Cat completion of Slo). 4» uhen process berminabes. e-emptton:- On preemphve Sehacluling dhe cpo vs alllocabed bo dhe prowsses. fix a specific tm period. The above eonclitons 2 anol 3 ate preemptive ‘schecluling. an da gho basks ate guitehecl basecl on priovity - fle peenptiony an fen Preemptive scheeluling, dhe CPU tS allocated! to dhe process until 6 teminabes. an dh scheduling No switching bakes plate, The above conchitton Igy are nop preemphve Sehaclulings. The Follouning ave dhe some Schocluling algorithms. veces — Scheeluling ¥ Round Robin schaclubing x sop Scheeluling X proniiy scheclubing ¥ putt level quaun sehooluling * muttilevel Feeatback @ueve schaclubhg ESES_ Schodluling' ¥ Tha sinplest cpu sehadiubieg, elgprithm 1's Fors l Fast wom Rrsb served). & processes one alispatches aceoreling to dhoi amival Hime on dhe Yeady quaus. # a 18 @ Non preemptive sebsclaling. x when a Process enters dho ready queue, Vb Pew ts Linked en to dho bull oP dho guoue. & when dhe cpu ts fee Tis ellocabed fo da process at dhe heaol of dhe guaus. & Tho vuntitg process (3 chen Yemoved fom sho Guus. a The auerome waiting dma oF PcRs is boo bong, ennsider dha following seb of piowesses hat carlve et Hme © with dhe lengtb of dhe cpo burst given hn milliseconels. Process Burst time Pi ay Pe 3 | Ps 3 af dhe provessea aves th dha po orcler peas order, we gel dha ‘Yesult Fue FS and ae setved th paso in dhe fallowirg Cont chat: Giant chart_is_ dha hot iushabe dhe pen schedule, Lneuolérg He te and Fishing times é ead of dix ertipating process: a Po] wom 40 0 The wait He for pros fi = 0 milliseeonds : , Pu = dh milliseconds fs = a4 milliseconds 4 : Ta average waligy tina = (044421) = 14 milliseconds. FP a processes ennives tn dte order Pa, fi he result wil be shown in dhe fetowig Cronk chan. | Pr | Ps Pi | re 30 Thx uoeiting tina ” for zo milliseconds f= 3 miliseconds pred mlisetonds Te average wwaiting. iia = (ort 2 3 milliseconds. a Fees Is die pon preentpive Sehacluling. ® pnw che Cro hoa bean allocitedl to dhe crv, dha Pieces | beeps dhe cPo uni it yeleases dhe cP0, exthor by | berminatng. o by seguatig, Tp, Te kum around Hime of proess p= ay milliseconds 3 Pura,» Ps = 30 ” | ” Tre average turn ayound Ne =(a4491+ 30) [3 = 94 milliseconds SEF _selnackeling= tonvey _e Feb All dhe. othat processes wal for one big process to get eff dhe Cpe. This effects tesults In lower cro and Blevice ubliation dhan might be possible VR dhe shorter processes lwe'e allloweel to go fissb. Isap scheduling: shovtest do b_Rint:- * Thy algorithms associates with eath processes dhe length of che processets noxt cpu burst. * The smallest burs} protess can be ass{gned to cpu, 4 JF dha two protess execution time are same dhen Fees sehecluling is wed to breale dhe bie. x SSF i's preemptive ex non preemptive. st [Process Buys} Time Pi 6 Pe 8 Ps 7 Py o Gant chat ts [om a | P3 o 3 q te ay cwautieg hime for Pi = 3. milliseconds uoaiting Hime for Pe = {6 milliseconels wating time for Ps = 4 milliseconds Waiting Hime For PA = © milUseconds. Werage waiting Hm = (34tb+4+0)/4 = 7 mulliseconels, Average tam around Hie = (344+ oF 24) [4 . =13 milliseconds. Conatcler dha fellowsig fous Processes » with dho lengtd of dhe cpu burst give in miliseeonels an dhe processes aviive ab dhe teady queue at dhe Hm as, ‘Ocess 1D Amvat Tine Buist Tit A ° 8 Po ‘ 4 Ps 2 4 Pa 3 s Gountt chor, Pil Pol Pa Pr 3 Online 10 ” ab waiting hrm — = Tolalenanting time — number oP witisecond Process executed - Prival time. waiting Hime fer pi =Clo-1- 0)ms = 4 ms wanting He for pr= 6=—-(\-0-1)=0 ms wouting Hime for Ps = Cit-0- 2) = sms weuting time for py = (g-0-3) = ams Average waiting Mme = (440415 +r yy = §5 milliseconds. ghoibest dob schaculing aye olhetesise eallenl aa Shovbesk yemeuining hime Fst schvoluling Corte scheduling). Turnavouncl Tima {bi process pi = (1-09 + (17-1) = Alb = 19 milliseconds. Turnaround tine fox prowss pa = C5-1) = 4 millioeconels. | Tumaround time for process Ps = (ab-2) = 24 milliseconds. Turnaround time for process Pa = Clos = 7 ynilliseconds. ANerAge Turn around TWme = CI+4+ asada = 13 mil seconds. ‘pignity _seheeluling _ a on priority Serudluling algenithm ath) process ts assigned @ vority 4 Re cru vs" allocatect bo dhs prowess with hughest priosity : a prtonity Sdwduligg can be eithor preemptive 61 ton preemie = Equol priority Processes are schodulect tn FcFSs order. genorallly ‘nbcated by some Fixed & Priorities are Suh as obo7 01 © te H0as- yange ef rusnbers val agreemant fy whether © vs lower & The Vs oO priority ~ 01 Yughest pmon'y- a some systems ean be Weel low numbers to hughast priority and others we Low jwmbers as Lower’ priority: lassumedt to have eonsider dha fallewing set of proesses arnvect at time o Ln dhe ended Pi,Pu + 5 ‘with dhe engih of dhe cro burst grr in milliseconds [process proriiy = a : a Pe ' Ps 4 | Pa 5 Ps o had ® Gantt chonk, [a]. ts th Ps Py ° ' b waiting time fr pr =6 milliseconds : wouting He for P2 = 0 wuilliseconds waitig tina for Ps = tb milliseconds west time Gr Pa =I8_ milliseconds waiting Hime for Ps =! milliseconds. j fuerage woaitigg fime = (620-418 D> = 8-8 milliseconds. (Average tun Ground Hme = 1b +1+19+1%46 | 601s 1a milliseconds. " u nop. preemphive. | | | ij | | i | i | | | | | a peony sehooluting can be either preemptive or % when protess arrives et dha Yeady guaun, iis priority U's compared enith privy OF eumentty sunning process sy Freemphive Scheduling algorithm * ent preempt dhe ceo iP dhe prionity oF che newly arrived prowess Us hyghor Shan dhe Prority of dhe curently running process. ww | | Stervation - wi ini | me majot problem untth yoonty schecluling | algowthm Ys starvation ot Undefinite blocking. | H process dhol fs teady to yun bul waiting For dhe cPv can be considlereal as blocked. A ymovity schecluling algorithm can leave some Low yrfon'ty wroess waiting endefinitly - ging: fess A solution to dha problem of etaywation voy Blockage of low prioity process i called aging. Aging imobves Gradually Lncreasing dhe priority of processes dhat wait in dhe ‘system for a long time. Rouncl Robin _ schoclubing Cre‘ | { w Tine shomr'ag Sypbema purposes only round robin Scheeluling | a@lgoritno chesignad- | * St Ve simile’ bo Fers sehodaling but Preemption addecl to | enaible dhe system to switch bekoeen processes. | & A cmall unt of Hime called a Hime guantum or Hine sbi. | * Tame quartam i guisrally Flom tee io milliseconds be wo mulliseconels. a dn RA seracluling dhe yeady queus (s treabecl ai dha ereulo ueus. | ® CPO Schactuler ee around dhe yeady queue, allocating | dhe cro to each process fox a time intewal oF upto One tHmo quontum. | 4 To tmplement RR sehseluling Heat dhe Yeady queue as dhe | Fifo Guaus ef processes. | ow New piccesses ame addect to dho fail of dhe | yealy qusue . | THe CPU Schecluley —pieles dhe now process from —teacby usu, sels @ fimor to tnleruph Phar one {ima quantum and elispabehes dhe process. consicter dha. folleeing sebs of, processes dhab ‘ane a@rived at dha Nme oe, uit dhe length of dhe cpu burst hme given Cr nuill'seconds. mocess; | Burs) Hime nee ay | Po 3 | Ps 8 | | JP we we dhe Hma quantum of 4 milliseconds thon ohe Process pi gets Fist (out milliseconds. sinw tf need notte a0 milliseconds. i 19 preempted afker dha Rist dime quantum , and dho CPU ts giver Jo the omt process w dhe queue [process Pa. process Pe doennt need 4 milliseconds So i+ quits before its Hime. guanta expites. Then epy ts green to reset Process - Fally dhe Cant chart fox R@ scheduling 15 Pr] Pr} Ps Ph a Pr Pr Py oA 7 lo 4 18 ga fb 30 fTurn around Tine = completion Hw — anival tme “Wun around time of procs Pi = 30-0 = 80 mallliseconds 7 milliseconds Torn around Hine of process Pr= 1-0 Turn around He ef recess Ps = lo-0 = to tulliseconds, aNg yur around tHe = 3047410 3 = 15.66 milliseconds. excuittng Hime for process pr = 30-4 = looaiting te for process Pre 13 = 1 [ waiting fime = Tumnayouncl Mme ~ Bush Ama] 6 milliseconds milliseconds looaitg time for prceess po = 9 = 7 silllsenenicls | Hyg wali ‘ina = 4147 = §.bb milliseconds, mess ons | rm Ra aoe (ae ee ‘Hine. quankam = 2 ms | | & : caltulabe average | PA oaiting time 4 fur | Ps 3 around time fox Ra). i | pr [eo | al Pi l m4] Pof po] Py] Ps aa Sa ee eee oo. oe for eat HOE ge oral jmaiting time for pisia-s =8 Ready queue waiting Hime for pr=i-3 =8 Cm | fa=3-) 2% - ~ | Py = bee a4 po /s (Ps Pi I ps) Ps=lo-3 =? Tun around Hime for Pi = 13-0 =13 Po=i2-+ = Rae 5-1=3 He q-ae8 Ps =1q-h=10 ONG tor around Him = 13 +n434b+tlo s Gwerege Waiting fm = 8t9+274447? 2 os millisecond funh. Ss = 8.b millisevonds|unip - s processes ae emily clomfied Uno frend groups a commen Aivision ts made bekucen fonegromne poe and bark ground process feregicunel —> Ulsactive — process bautsground > batch process a These wo types processes have cbifferend response Hime yeyurertants ancl so way have afferent sehacluling needs. © ywutileel queue seactuling algo: 8 In dus algorithm partitions dhe yeady guaus {nto Several separabe pususs. = Te Proesses ane permanently assigned to ene gue gersrally bazed_ 00 ome property oP dhe process, duch a3 Memory si20, protity, 01 process type. & Gach gusua ha ts ewn schacluling algprithms. | * Separate gueum are ued fy Rreground and | backegiound process. |X The Peregreund mugh! be wed Re scheduling and | Tate grousd wught be scheduled by Fees algorittn, | The wuutilevel gueus scheelubing ‘algorithm witd ve quouss, D System processes 8 dnkotauhive processes D Inlotactive eciitiag proms 4) Balch processes Ss) étudeni processes. \ ywonily cs Iraghed ' AN Sysher processes. A nteractive Processes => Corder prowiy rautilevel, Fett usu sshedulings when a wuttileel guewe schecluling algonithen 'S Wed, processes ave petmaninlly assigned to a gusts ehen they entor dhe system. af due are separate quays fox batkgtound| Anol feregionel Processes. €9:- provesses do not move Form ena One gueue to another. sine processes clo nob change dhol foregrounel ot bavkground nature. XI allows process to move lekveen Susuas, 1° 8 OP dhe process User too ‘Much cro time, iF ull be moved to dhe lower prionity gunus. * Tha scheme Leaves So bound and inteyachive Piocesses | Uy dhe Ighor prionly gues. | a, process dhat sai’ too long ch a ine fron | Fuse Moy be moveal to @ highos Priority susus. ATE form oP aging reverb stowation. foy example eonsidei multilevel feel bacte quae Scheduler unith dhe queue , numbereel from 0 bo a —> | —| quantum = 16 "| | a FCPS . | ea Schaclule exccubes all processes in uous 0. ca only when gueu o V's empky wil) ik exeeutes prowsse tn Juss |. a Similarly gums a will be executed only IP gueus 1 and guava © are empby. ln piocess dha arive Br gh wll preempl 2 process th Zt «8 prowess co gt wil be preempted by a process aniving for go. n process entering dha Yeady Quoun ts put Nn guous 0. 8 process In guau2o 13 given a hima guantarn lof g milliseconds. af 18 cloanot Finish within dh Hm, i os moveel to gho tail of uous |. ar guaus 0 Us emply gra process ft cho head of queue 1 ts given a guantum oP 1b milliseconds. IP it is oer nob complete, i's preempted an (9 pub ino gueuss. processes ch guevs 8 ale un on lan gees basis bud are yun only when gunue o 41 1's empiy. gh | | | \Muttiple processor scheduling | multiple proe sso! o Mattiprocessot Scheolabing Rewer on, Alesigning dhe... systems sehooluting funtion, which consists of more Than one prmessoy. | Multiple crus shave dhe Load Lv muttiprocessox Scheclubing 80 dhab Lariow processes , Wun simultaneously . % multiple CPus Un dhe system axe close communications, ¥ J shenes common bw, memory and ottei peripheral devices, x So it i's called @ Hghtly coupleel system. ¥ The Protessors are Ydentical aa Y hemo geneous: we can We any proesse! availabe torun any |rocess to dhe queue. Ceoithin same Puy | 7 betevogeneour.- only progrars Compiled & Qa given Processors inuinuction set could be yun on dhol processor. Cewitoin UF Rrend cru. proach to muti pews. Slain ) Symmetric _rrvuttiprocessing:- way is wed whore each Processox ‘3 selP Schacluling - * PL Prowse: May We Common veadly queue > each jprotessor may have tts prvabe qusus fox Yealy iriocessess. ©) asymm ¢ muliiprocemig= : SH ts wed when all dhe Sehaduling deusions and ko processing are handled by a single processor callecl masbet Sewer. The thes prowso1s execute only dhe wer code. sg a) processor affinity: When & Process yuns on a specific processor, here axe contain effec on dhe cache mertory. the cata most Necently accessed by dha Process Populate sho cates | i dhe 2501. Suppose ohe process migrates fo another proeessoy, Ire eonten} of dhe cache mamory mu) be inuabilated for she Rist prowssor, anal dhe conbent—of the cache fy ote seconel prowssot Mund be “Yepopulateel Tost smp system avorel wMgration of prowsses fforn ene —prowssor fo @noltw!,- anol cutead alfempt to keep A process tumning on dhe same processor. Th dG knowo @ lyrocassox affinity. Two types are, © soft _affinity:- when an operating system ho a poly of keeping a prow ‘sunning en do sam Prowsot but not gusianteeing 13 will do 80, tha situation are called sof} affinity. @ Havd_affinity :- Word afftuty allows 4 proton to specify @ Subseb of prowsios_on eolueh! it may Yun. [Lead lbelaneing:- Load balancing Ys dhe Phe monon dha} Keeps Kho weitkloacl evenly clistibubeal across all Plow ssoxs ip an e7smp system. load balancing s newssary only on systems where @aclo prowssor hos its own privabe guauz ePa process dhad vs eligible to emecuke. | hwo general approaches to Und blaming C | | push _nigialion « | © pu iJ On push mination a bask Youtinely chiles dhe Load on enh processor. IF tb Reds an imbalance, | p | VW evenly cistibateat dhe Und en carr processor by moving gho prowser fiom everlnadec to idle, oy less bys busy processors, /® palt migration : | Patt mugretion ouurs when an jdle Peso | Pulls a warting boste From a \busy Prowssor faa | ‘bs execution. uutionre prmcessers: a Tro hardware ha been Plawd muttiple Prowssor cores en dhe samo physical chip, yesutting ine multicore prowsser. % multicore — Prrowssors may tomplicabe Schacluling Usues. * when de Yrowssos Quesses Memory , i spends a significant amount ef dim waiting for dhe dota to become aveulable. thd situation is called memory stall. Thene axe qwo dyper of Multithreading a Procssoy - © coarse Gnained mult} ng += A dread execuber ena Piowsioy until a long laleney events uth as momoty shal oces cp eoeyse gYouma Pruatitnendling Became eP dho dolowy camed by dhe long labeney event, dhe Prownot Muu) to awitch to @nodhor dmeaol to beginw exec Hon. @© Rina _Crrerineol_muriditmeaoting:- switchos between dhreads ata muh Fine level monly at dhe bouncy of an dubuchtom- 29 cnelucle lgie fox & tHrieaa suiting, ancl @s @ Yesulk, gho tos of sunkhing between dreads 1's small, ee coneurrengy _ tontol!~ Both ‘nlerleaveel ancl Cverlappesl prowsses can be LUiewedt a example of enncurniend Prowsses. dhay hodh present [the Seume ert proce Pt LIZZZz WLLL) pe 3 Geez | [ anleileaving (must iprogrorming , 072 prowssor) I ee ee | pe (ooze | 2 Inkrleaving f overlapping Gruttipouning , two procenon) WIA — dlocwed Tanning Problems Co tonumency conhol:- Y shaming globel_vesourees:- Safely sharing of gual Yesoua Us aioli) af two processes both make we of a global variable anal bots perim read anal write on dhat vaniable, dhen dha order in which variow yeaol and wrike are execubec! i's cattical. o. optimal allocation of sesounces:- Process B mou yepusl we of andl be granbed conivol of a pentieulor Glo channel ancl dhon be suspeoded before uning dhol channel. gt may be undesirable for dha Operating system simply to loc dhe Chane} enol — prevent Ib we by ether pressed: Indeed 14 may lead bo a deadl lel. eonelition . Q? | 3. Locating programming errors: UOeGITAY as PINE : at is very cbfficatt to lecake a Pecgvemming error because Yepors ave twaally no} Ye producible, ey: Note echoes chin = getchow.C.); chout= chin; putcharCchoud); Tu above, prowclure Shows dho essential Clements of dhe program dhod; coll Provide a chavacer echo procedum, npal 's ebleuned From dha eyboarel on Wey stoke al a dime. ach chpat character {8 stored dr variable chin. a 1's chen Hrorfemea do ého., variable choot anal send 4o display. tow consider we have a single processor Muithiprogramming sysbem suppovting a ingle WEI. The Wet can jump Pome ono application to another, anal eath apbications uses Che same beyboara for Cnpub and cho same screen Ry output. Becawe each applications naedls Yo use dhs prisdure leco 14 nakes sense x ib bo be a shoved Plowdure hat I's loaded into a postion of memory glebal to ail applications, Mus only @ single copy of dhe echo Ptowdure (s wed for Sp saving Spaw. Tui sharing ean lead som problems, f cess pr invokes dha echo Proudure and 1's Inkerupbed Crnineckiabely after gebchan returns fy yaluo andl store i io chin. at dus point cha masb recently enbered chavacber x ts stored in variable chin. af | ae pieess fe ts adiated andl Lnyokes dhe echo procedute whic yuns in conclusion, inputting and dhen displaying ; ‘ a single chovackey 4 pn dho Sete. press pr ts yesumed. By dni dime dho valua x hay beon eveivontien Ur chin anol dherefore Lost, Drubead cle Contains y ushies ts Hamférect to chout ancl displayed. Suppose We Gay dhat ently one process lata Hine may be dn dhob proceelue. then dhe sequanta would hesury do dhe allowing: protess © pl invokes dhe echo proudure and Us interiupbed ummecbiabely aFter dha conclusion oP dhe Unpus Fanction. ‘The most recently enteteal chavacker ac U8 Stoved Un Variable chin. : prow peu ativated andl tnvobadha echo yroceduye. pe ve shit cnside dhe echo procélure , although cumently Buapencled, PR Us blockeel From entering dhe procedure Thorefove Pr ts suspenoled awaiting dha availability of dhe echo Lure. Proe a ane Later dme, Frocess pi is resumed and Complebes execution ef echo. The Proper Choracber x cs displayed. when P. 6 hh i 1 ents echo Shir yemoves dhe blocks on i wher Pa 's later yesumed dhe echo prnedare is Suuessfully invobed. ssw ere CONLurTenty’ ® Rewo_conelitions:-_ H wow Condition occurs Wwhon muttiple processes by Mmeols read and eorike data Ykers so dhol dhs Final vesutt Glopends ov dha order of executfom of Uukuchons cn dhe muttiple Processes. | eg | tonsider dwo process, 5 ancl P¥ chal share glabol Vertables band ¢, wit iwtial valu tb=1 and ¢=2- Ay some find To its execution, ps execute: @? assignment b= b+e. at sons point tn Mb exeeution Py executes an assigo want = bre. Tw. final value of tix two vanable doznds on dhe der io which gh f00 proses executes shoe dwo essinmants. BIF pa executes Its assignment statement Fast, dhon dhe Fina value ef b=3 and ¢=S. | a AP ph, execuber it assignment statemond firs), don dhe Final valu of {ps4 andl ¢=3, : © process Interacton:- Tha dinee possible egress of ween plu dha tonseguenca cn process Interactions are, # protess Unaware ef eaich_oflies;- Thue are Lialepenelent Prowsser dhat ate nob inkendled to work together. The best example of dhu Situation is dhe Prulniprogrenoming oF” mutiple Indepenclent processes. These can either ‘batch jobs ot interactive Sessions 61 a mixkie ¢ ectly aware _ of early other Those are preesser dhod are nok neessorily aware Of each other by dhoit Yespective prowess 1s but dhal shares, jaceess to Some objec. 8 prowess _cliyectty_aunare ofeach other: | These aye processes dhol ate able to communicate juoity enc oer by process tb anal dhol are clesgned fo work \ on : Joi Some achury. Bointy ty @ mutual exelusi Suppose 4wo oY more provesses Yeuire auess toa Single nonshonable Yesours’ such a3 printer’ cannol be wed Siutangously ancl hone mutual exclusion condition is nacessany. That is only one Prress can. we dha yesenm as ANY given me while ethers wat By Enolivilual yreess to have eontol. of dha lentite File. othenenice line ® Pract (wee Deas lock ('s dhe situation whore each oP process wait fox @ tesouru evhuch i's thor processes. @©_sjawathion= J Starvation {s dha problem dhak eccenys hon high Priority Processes keep executing anol lew Pronity processes get blocked 1 UndeRnite He. ———— dhelr tum. we want any prinkey while’ 1} Pah eu fiom Competing process wil be intenleavedl. dhe computes being assgnedl to some See esse sytoncals, De ns procss ean be cad by Und Rese proess & executed completely, the parent Bess S Sse, ‘Sone of be expense porss on rk) are as lous, + The narene wi get ne end process D wat nonce valve, o ierVaiesrimesnoeax euge mont - nouns Systero_catt Entrar for _procon + Frere wal be any system or hattware erors whe cresting the chi, fis rtumed wretnd + See unique process ID abtanes by the child process, does not mateh the 1D of = socess and pid Sa ta\etsgeenidinns exec() ‘The exec) is such a system call that runs by replacing the current process image win the new process imag Process but the new process re ‘Program tram te entry pont by loading the program into the cutrent process space. To elaborate more, la’ take an example as shown below. ? wait() as oF 14 13 rs | mJ os] 9 fr 4 4 Cron chet ° =9 O, Pr2i3-6 pe Psa qesey Vv-b=u1, Py= +0, Pa= 0-0 Gers eg: = + | =| 4 5] 8 iS e| | 6 eee 7 Oo ° : 3 2 & b= 9 en 7G coe ane eee& ob £ = : & ¢ 5 2 Og TAT OF prown =ssn4s41342 13 8 =M-6 Ps= 13-5 Pa ‘poinidea 5 ss0001d epee 80 3589 a4) : op yoo wersks su ss00014 ‘49 oyeuusy oy posn sei se woIsKs 649 J OUD 10 UoRDUNy w Yo 5 x9 OU (xe t fo uansex f tauorrya"tax) 3748 ssbuyaaoy UF foasg.) 3 I0Tad ) oero d106'.4\PR ST PHA pue esao0rd auesed oye ef az4)] Usd , (0 < pray sta t 01378 a UNI ‘ey points . A program in an execution states are called as process. 2. Heap is dynamically allocated memory to a process during its run time, 3. The process has finished execution,then it is moved to the terminated_ state. 4. The program counter indicates the address of the next instructions to be executed for this process, 5. A process that has terminated but whose parents has not yet called wait( ) , is called as zombie process. 6. A common representation of process scheduling is called as queueing diagram . If the parent did not invoke wait() and instead terminated, thereby leaving its child processes as called as orphans. . A Deadlock is a situation where each of the computer process waits for a resource which is being assigned to some another process. 9. Starvation is the problem that occurs when high priority processes keep executing and low priority processes get blocked for indefinite time. 10.FCFS,RR,PRIORITY, SJF all are CPU scheduling algorithms. 11.To access the services of the operating system, the interface is provided by the System calls 12.CPU scheduling is the basis of multiprogramming operating systems. 13.Lack of paper in printer,conncction failure, power failure can be handle by the operating system. 14.In Unix, forkQ) system call creates the new process. 15.FIFO scheduling is a type of non preemptive scheduling. 16.Thread is a light weight process. 17. Threads is not shared among both stack and program counter . 18.A small unit of time used in RR scheduling is called as time quantum or time slice 19. A race conditions can be arised when multiple threads or read and write data items in concurrency. 20.The long term scheduler is otherwise called as job scheduler 21.The long scheduler supports or controls the degree of multiprogramming 22.The process can affect or be affected by the other processes executing in the systems is called as cooperating process 23.Data parallelism and task parallelism are the types of parallelism 24.A thread that is to be cancelled is called as target thread 25,One thread immediately terminates the target thread is called asynchronous cancellation. 26.IPC stands for Inter process communications x 2

You might also like