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

Unit 2 Operating System Notes

Uploaded by

Ex Maheshwari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
20 views

Unit 2 Operating System Notes

Uploaded by

Ex Maheshwari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 16
| UNTT-2 - Conenvvenk Process. Full exprainadion \ Agenda | objecttve- \g a [objec e E \ 1.] Process and Process moder. a 23 Diffeyence biw Process & Progrown Bury a walt and blocking watt 3 5 3.1 Principle of Condurvency - Paes ig 4] Producer Comumery Prokiem- 5.J - Mutual Erolusion , 4S condeiony and tequivements. a aa Citifcak Section Problem. fe fe f Dekket'S salution ; | a Bwy waiting © 9-1 Petekson Soletion, difference bio Ae [ Coneuvrent % Parallel execution, : to] Semaphore and it's tmprementadion Scheme. At Sosution of Producev Comumey Problem wing Semaphares . 12] ~Finfte budfey_ producey comumey Problem. 13) Reader (writer problem & RS solukon £43 Chossicok Coneurvvaney problem. 15.) InterpYoes Commurtication. 16]. Message Posting Systern. 7A jaye Cet begin. =~ 1] Process_/ Process Model ~ 2 Process isan operation which taker tubes” tions _and execute accoiding hy. y This_is a_sequentlas_progvarn in exocukon. q Te contains “Pur sectors - Text - cortains progam (code. Ls Data information” e LoHeap- dumamicatty allocated meynory LSteick- ongaliy empoiety dodee na ok A Heap Dake Text a 3J_PYocess US Pyaqyayn es ell Procers Progyam, > taka frtiuctions & | Tt tsa setof (mtiu- perferyn action. clon. 3 Depend) on pioqvamn.|-> Prog art are Indep on. ndent. > Separable x loadable [7 performs a task / module thot dum dak to an ca coneurvently, ) 4 [paee] Page: ees > Tks an active > Te is a passive enktty, | entity, Busy watt vg Biocking watt - Busy watt | Rlocking wart wy) J Ws fa Soop teat [8B TH fe a situation Yeads the states unite] where Infinite waiting busy dit_ become cheay._| Occurs. ee 7 Thoceurss when > TE oceuyg When pYocars Scheduling overhead és | Yerourees ave needed foY Sovger than expected another task. | watt time. SENSES Rome ah i > Tt ts schedule bared | — Schedule based ah q approach. approach _f ‘nappropsiar, i £e. Ea — | 8] Principle of Gneuwyenw - : UO > Tt is the concept of things to Papper at the game time im a system. Td Tt ig a technique that wakes proqvarn move usabge. 7 TL based on folowing piindple — 2 execution speed nat predictable * system fnkevrupts rot_predietahle. © gtheduli meu pais bekege Change Exarpie. Loading “rutti ple is ina tab is eoneuttne ok gate Ene. = [43 Producey Consumer Probsem, iE Stott} ing, i ua —S | 2 Cor ss & | Producer —_batfet Consuim ef || Heve, Produce’ PYocess + Produce data item Consumer Procers Comume dasa item > buffer is wed blew _praducer 2 Crnsumey process. Rees S S Problem t wi > if Butfey ts fal then producer can not store data item in tt. + # Budfer is empty +hen consumey can not ACO une =) Solutons- | _Tf batfer is not fat, Producer Produce) stove data eue Stop and wait urttt buffer Tg empry tf buttes fs not empty 5 emumer —> Conyume /accers date else cies watt unttt buffer becomes gon. [85 Mutuat Exctuston - > _ Tt ts a plocers_ where, she Ls chal allie I k Teputeet wins of c = coae v 9 iv L DD = [ OT@D Ke it eoatting state - 7 a >_f ene: procag ig using gome shaved i q YOousce then that Yaoutce of Talahle i i wit be exctuded fiom ote’ procesgea, t Condittons — y No _Aeoo_proeerzes com be msde critical Section at a xime. : +_Cani deermine + processing speed mo. of CPU, ° @No pacees outside is orrticag + Section shawd block other ¥_pTaceiges. 4 « No prC@s chowd wart Sibiond Jong to enter [ts NS section. a} Date: [Page: Requirements 3 Wo deadJock state > Efficient wa (kind. | 3 1238 ten “ie. if >_ WS chances_of clash | 4 33 Crflicad Section Problem. @ Stution 49 Th isa code geament inside a procag where shaved resuiee ave accessed. > Bach process has crttfeat secton. AM processes Crecutes tn Critead Secon. |) Solukion- 2 Mutual Bxclwion eo Progvess £ tf evtecad. section to ompby. and proces ae exoeuding cudside vite ical Secton then those pYoees con cme iwide cvitcal section in a maintoined yanney. ; = Bounded warting J Each proceg Fos Bound oy Limit that a Row many dimes, Tecan _enteY to Ite evitial Section, pare | LI \- 7 Pakevy_ Adgottthyn « §3 i a i Teed in nudliple proce Sntubion. Fealver aitieal section ptalern for 1 fal ‘cesses. Process <> Token —9.——$§ Taken ra > Max cprevioustq gh ven TN) J Fis Aigotithyn od Potmed foY develo Aeenbuted Venvtvonment F Te antes procgges_frutde thet ar itical (Trees fed het ken wo foo] Ta drawback ie do mot sue that 400 processes can not fave Same token 10. 9) dekker's Sotubion - = fei two pacesses based on #0. * Seu Pee fy (Sarl ae = te loo cheek asta’, ° a blaakioatd t J Process Hist enters tn ae > hen after checking pYacers mia. on black tpald, te enters cvltleal Seetion, 2 Date: Vv Page: f 1 i) Bi 3 woadttng - Tt occ, a Process-2 tYyfng t0 ontey fh evitfcall ceation. Process -4 alyeady tn Cyittead Recton but 10.} Peterson Salution — > Cassfeal Yw based olution af critoal gectfen problem. 3 Muduak exchusion 18 assuved. = Progress ts abso axsuted » >“ Bitinded watting & piaerved: + Th peterson's SaluHon + wwe have 400 it Shared variahtes - i Q) int tun? “The process whose tern us to enter the cvitfoal secon. Gi) bookean flag $ this ig used 4p wd tale ~ whetheY she praceg fs seady to enter the critteak sectfon or not: ovtthm $ do } fidog LU1= TRUE tune Fi Lohede ( £909 LF) 88 tuYn==7) 3 euttteal section flag (t= Folse; i remainder section i 5 white CRvE) 5 | 41] Concurrent oxeukion US Parallel eceoution, faxed Execution __ Concurrent Execution >_when operatton ean 2_when operaxions ave |_oceur at the game etme. done at same me on diffesent procersorg. Tt fs. the property of sthe_proqvam. 4 U > Tt ts the property of machine. ca D> _Tt ts most wefet method for _stinctuyty 2 TH execution efffetency importa & programm that needs cthan_we prefey te veSpond te multiple tru. payavter execution, t 42-4 Semaphor 5 3 _ Te fs a variable ov abgtvact detarep © used 4 conto’ access + a Common Yegsurce. Fit provides a much mave oiganiged foach youl set ; eppvoach for cont alting Muskipke pYocesser > they axe foals which ave wed Io vealige “the mudi enelusfon. 2 {ek 1 Semaphove $ fe an inkeqey vartable ie can be accessed using too atomic TS operadores , walt 2 Stgnot.- = watt (Ss) § twhiletS<=0) a T® do nothing* / J Se 8-15 4 8 iqnad Gs) Eat Ea = oa | Sz Sad t exampseé Po Process, S2Statement 1 ks) Py Sa me need & executes aftey S2 ontey : — then tue can be contyalted by semaphore. a || Disodvantaqes— + _ Simple aigettthm yequiye move than I one semaphore. x Te & compler to Implement: ___ [| * gemaphores ave too Sow Level.” & Yery senitive working blu wares od signals otherwise deadiceks wit oceuy. “Technique to overcome the daadoaroge of semaphore. > to oexeame at the disadvantages , we modify the _defintton of wait H8iqnol. + when @ process eretutes the walt operati- ON 8 finds thet the Semaphore value i$ not positive , the procele blocky itsext. ~> ‘The block opevation places the process inte sone ce nce sen a waiting state. Operations of Sernaphove : 7 wo operators ave done, waft 2 SGnal. > _ entry 46 critical Section & controled bu_Semdphoves. watt and signal operations aie _also cailed Pand Vv operation. Solution of mutual excuuion using gemnae Prove. we assume that the poo comets 0 THER, each eapahle of -hodsling one them. The mudex semaphove -pYovtdes muctuat j= exclusion for_accerses to the butter pod and ig tnftratiged te the value 4. hi = wart (fell) § wait Cmuter 5: [I Yemove an item fvam buffer to neste? Siqnak (met ex > Signartempty ) 5 [Lo@mume the item tn ev nertc S$ whive CTRUE ) 5 Prvaducey Comumey Problem Catution + EF the 1a] Finite buffer producer ensumer pyoblen Solictfon wing semaphoye. = Producer Consumer prohvem tS dfsens ged prevfousdy 2 _+hice semaphores ave wed - e bfnavy sernaphote_conkvak access © the butter reset. : 2 Counting gemaphave counts empty Hoes OF Kady emptsy Slots . = « Courting Semaphove auto Keeps tvack of slots (1 Vbutfer- k = Gubsetthe to — Smart Engineer Bab if i on Youtube. coche y i 44) Readey | wrttey problem. 2 > Tt tea Synchronization pYoblem- Te compares and cordtast cunchtoni- gosion_ mechanism. i 2 baste] a Soa | SOD \~— A - 2 write Read egnor rgnrpmerapem i enamceane Pr. ~~ Pq = Process - 8 Pr wants to perfevyn Write ofp operation « PaZ Pe wan tw perform vYead operation [then the: prohtem arises. Sodudion $ > _we ean overcame +nis problem wing aaa || Semaphoy es. we We, wit ¢ int Yeadeount : ~ molt = 15 Q_ initraligation veod countt= 0} 3 Page, aa ~y wit 9 18 for both Yeoder & wwiter, 3 _veadeount variable keeps track of how) Many pTOCesIes AXE curently eading “he objects: ss “Test 8 Sot machine tnatvuctlon-g > wed for impseynenting mutual exctus ton. ; i ~ often called a sock’ byte oY semaphoie o =, i 4 42 srqnailabSe » edock- byte =~ i of Toor bbe 4 me A. Seti dock. bute = 4 =o 165 ehassical prYohiem of Coneunt¥eney = @ Produce Commumet Prabsem JF H)_Readevs (writetS proktem. Gai) Dining’ philos pheis probsem - > Cfasfc syNehvonigaton pyobhem. O+a\ i Se Se #! Se : i Xt = SKGubsor' be to Speit cer fe “Babu (osieens. Cv) Sheeping Barbay Probsem + 12.J Tnteipiocess Communi cakion - > ako known as Ipc > this is_a mechanism th¥ouwg h which PYocessey covmmunicater with eaeh other. Tt lows pyacese 49 be Synchronized ag 2 [pa $message 5 e2 =) _Tnterprocersor System f Communtcat on is best “provided by the two fundamentals. Gs Shaved memory Systeynt Tt [Pe] [es] CP2 { —— —— b. Meisage passing Systern + Date: Page: p, Tea THT Pinks] message queue 4 ae Read - message passing tr detakk wit SKOMNPRE

You might also like