Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
9 views
OS Unit 2 Part 1
Operating System Notes Unit 2 AKTU
Uploaded by
Shishir
AI-enhanced title
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
Download now
Download
Save OS_unit_2_part_1 For Later
Download
Save
Save OS_unit_2_part_1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
9 views
OS Unit 2 Part 1
Operating System Notes Unit 2 AKTU
Uploaded by
Shishir
AI-enhanced title
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
Download now
Download
Save OS_unit_2_part_1 For Later
Carousel Previous
Carousel Next
Save
Save OS_unit_2_part_1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 15
Search
Fullscreen
UNIT- IT CONCURRENT | PROCESSES SS PROCESS CONCEPT ¢ (bala Wr priatious site’) A process ts an eartuting pro including eunent voluLs of tht 4g. 00 ; Argistew variables, pAoters can be dusoulbed as : To bound process > spends move time in doing Jo then on. CPU bound process > spends time vr comput odion. Process : $ en Co- ppercdive prouss. PALES ade > cont aject by othr process Santp. shoving “> dotun't shore data, ‘emern-, > comput ou” sperdup . variobl, code ote. > modularity | 2 oO {ser work, oh. many Oaks Ob tht Tie time) PROCESS SYNCHRONIZATION: PpRocess oe % contwisunt arts tb o shosud data roy auutt Sn poga Scone’ * enanroining dato: condibtency Regu, “mechanum Yo endure eal exoeubion eb eoppeiating pooetes,Example: int shaud= 5 5 Pa ' 0 mt w= vee ode ye shad; = 5 ett; é | yon Alup (1) 5 sleep (1)5 ahora ef) saa 45 4. Bern processed ars eneuttd parol Rut shy yer erwikon, is UnIpRowson. 3, auquanen Of extention 4 the phous wy be he R2HPR “ prowases aw exeerted se bapa ae co- open ~ tive proses but = Yo known ab "hoe condition | dhis type ri eek PRINCIPLE | OF CONCURRENCY Concur MIVLY > interteowt 4 processes in time to gine the appienand a el LLORUSLONL PSSULbs yy shanin global ALSOUNLES + opemaL cation, a ALSOUELS ¥ tocating prognarnncing eons % also inthoduts th watt nok tf paoensses mary: gun ok defh Sperds. RaLe . epndittion > oceuns usher mulhipls proeetes, ov Usreads Read ov “pailt data items 0 thot “ginal DAU depends on thy ort Of eRCeUaEN of instrut: 8) fn thy pouliple Processes,theupore, OS conwurs fell. things : 4. 05 must bt Oble to keep track of Vorrinud proteases, 2. 0 Must aloe % challorate various ALSOUELA fOr each aetive paoresd 3. 0S must pAoteet th data & Pp ico RSOUNLL Of cath prouss agdunst unintenaud © inieyouncr by mh. processes . 4. The gunctioning a process % the of Up produces must be naupandled ah Spee at whith HS purution is cassied out wative to She spied othe eoneumsent processes. ' PRODUCER CONSUMER, PROBLEM et Have one J OMe wndumer beth ars coming at au ome time % ay OME -ALLOWILLS > CO-OPEIOEV CONSUMER COdE : void consumer (void) i wt Stems 5 exeuiion tn PU: whi (true) ‘ stO0 WN ; i naa 4. Load Rey ™ Ctount] [est Teount = = 03] Up, 2. OECR_ Re emt = Quit Loud], 3, &tove mftoun], Q, out = (out +1) mod n + { ‘ ’ : wound = wound 15] Prowus-Hem (Here) 4 Both prose anu, sharcg fy © Buse (Memory) @® count (voledte)PRODUCER, CODE 7 UE fount = 0 | void produc, (void) 4nd temp 5 : obi (true) exeustion fn CPUS produet, Aters (Herp) ; 4, Load Rp, rofvourd ) [while Count ==n); | exes” pos 2. NER, RPS ‘uo Lin) - : Herp 5 3. stove mount], Rp 5 ‘n= Cin +4) mod ny [tout = unk +15 5 th (0-0 ‘la consume OF ' by ays [oil sf el oie ‘ ene ita daub 5 is 220 (0) 7 % Fells the add. ad [i of ae eng 9 bayer". cose D ; Let Hemp =o igo in ine Co+t) mod 6 = [4] now, count. tes no, 6} tems present Xn wa Hy 0 Wetigg Spout ott ' / Now, cheeks How consume works ? Hew, — Sterne = Buyerfo] = x 5put= out ¢4 Mod) @ | = o+4 med Oo: [A count = 41-1 = [&] we Hem om buyer | —Kke case @; nee i see ms a out 1 [oat : 4 5 count 6 + : (Pye K prowess phaduts 3 “ems (Xj, 2,0) q steve em bupor, New, HS Auady 1 produce 4% Storm, (74) put Lin] = Temp = %. 5% place at place 3 in = DH Mod N= St! med @ = (| count = Bt! =], Now, consid ; two Snapuctions 7 wad Re , mCvount] O Ca) Hutu auterssfally, 2° TNOR Rp © fe then, pAouss preempt bey 3B. Store mCeount] Rp ® A LONOUPLA —PADUAS , 2 wounk not Updated, Now, tonsUmey tode works Stemce = Suppor out] = ®[o] = % wt = ot! mod 8 = 4 2. yOdenglrs Re oem 5 B-1- 2 (Same, before ereutin sieve mLsount], Re prowsd preamps agai by Prluus, at Producey side, SF wesuines. Finally Ta exteuted & venus oh count why Se (E) 5 toerinated |Now, eongumer exetuced Sie Ts Fnebutton, “Hou, [Re=Q now, load mount), Re 2, feount=2] now town ‘s updated | ecnsumey Alay {taminatrd _ count = 9 s0ys, 1 have “tase ems to aye Bat, m acmal , VWs . Three. Kis probum is coud Roce Condition {wwe cout arhieye — proelss synchowinatton hike Hie of this, sequence, o_esustion | Pim en, Pi C ta. CRITICAL EN consid o a 1D) of nn ctr aan | ent af cool. He caltica) Seuton i wshich the Prous ay. be vere cornmnon | vanlobles , _ upaaniog Q file wohen one paotus ts exeusting 4m tag eatHtal Avction, No oth, procs ” % to be allowed 4d exteutt th Ys cadtcol section. muinal excwsive- No, wo pooesses ory exteusitg %n chur escitical Bein at thy same me ,o = do { ENTRY SECTION. cated! seetione EXIT SECTION Remoinc secifon 5 whur ( Taue)s“Example : process. Py Process 2 te include
44 include 454dlo.h> main () main () Non. criHeal section « ENTRY SECTION Non-cattical section ENTRY SECTION caiticed, Section eatticol Section EXIT SECTION EXIT SECTION SOLUTIONS, OF CRITICAL SECTION (PROBLEM| 4. Mutual Exclusion * only one, process aie time Bs avowed into Us eattical Settion. Requiements, for Mutual exclusion : 7 4 0 Prous that hots Sn US non odHeal do $0 without wreqerdng with Oth, processes. y aL roust not be possible for a preess vrequiss fo 0 Ulta) stttion to be delayed’ Toaufinitely No. deadlok er staswaton, | x when no proces 1 tn @ obtical seuticn , joes that sada pe O45! emttical » Section must be pesmi- udithout del ye No assumfstions ay made About ~eatve proses « pete ee Peeasor A prouss —“VerHaANS eee Ys esttea) sect. for a * gintte time ma : Auton. must iy access,a ie a > calHcol suction Us , none af the p, A process & bauer the, Now, Py wants +o entey In Hs eribeal section Shack) om the othur hand, fis not Sntertsted otal | fo twtencting His enbHea) Seubton bu secthn J Ts staying to sep FL fos execu his chiical section No pee by omy pros. & Bounded wait > A bound must exist on thy oo, of Bmes that othur Presse vu atlowed to enter aped} eattical section aftr a prowss has made a 74- fo entor HS ehiical - Settion & befose thas SUQULSE ws aqvanted. : > amume that each prncess exteues ot pon x60 specd. 3 No _assuroption tonexntng welative Sperd sf, the N phocesses, 4 cond’ need: to held to have good aoj” * @ No two presser m be sirputtonenudls enter. snajle, their -eMticol “Section. © No assumption may be made about Apud "proce 8 : ® wo pws aunoing outers Hs. cS, may block. } othe — pspesath | @ No proetss should hove 4o wort , pred fo erden S45 enmticad section, .DEKKER'S — SOLUTION blag [To]; = true, while blag Cry = pave Ai bw # 0 Hag Loy i= pose while twn #0 7 F pag Lo] y= tue ¥9 Yo tical section. funn 7 - a blag Col: = false I semaindir section Y whi (TRUE); he tor two processes based setely on gio, ech gnese procses loop 0 , repens entesding mis C3. PH process = and A wish +o exttute HS CS fost orders thy igloo earnings thy blackboard. The. po- ews number & writtey on plackbeand , thar Process roves th igloo Q protuds to ¢5, othewue, thar wow wood fos “ds wh, SF repeats this enesde allowed +o enter Ws ¢6, Tis prouduse ts Algo. go" a one prous elle, other uPETERSON'S , SOLUTION do stag Ci) = TRUE } | twuy= $5 while ( plaglid- RHO = =F) 5 eaitical section. : . [pegct] = FALSE 5 pemorney section, J while (TRUE)TEST and SET operation . As) Sperial Mie instAuction used to avoid mutual exclusion, 4 can be dupened as follows boolean testset Cint 1) f i Liss 0) i isl; Awuy TRUE 5 dae L xeon FALSE 5 Fy above yunerion is caried out autor net ay. tS) 9 ov a simple & cay +o vest a applicable +o any "0, iene + wed to purport Multiple enitical eetions. ssp! vy" as 7 wali osstble. y stewwation” ts abto possible. w tho Noy be a dtadLoek,Lock yoriable ! (oldest Method) @x" t ee Wok 4. whut {lok == 4) ony cattical Suction. 2, wks, cod’, nulrase, Lock. 3, cAuiCOl SHON M [ bok=0 5) ot code “> exteutt In user mode \ => No quanantt oh mutual vtlusion cae) (ek Cee ae | Note :4 Loek= 0 means CS fe empty =1 " a Py exeeuted. te Rete Tr (woke =41) 2 (o== t) @F wow, 9 sts volt of botke 4 usty eben In CS. In tty meanwhile, oP wants to enter 5} can} beoz. Lok= 4 pow. _ apts the comption ay | PL. usw end tude. vice versa | case® % excoutid, Tr (0== 1) @ Fae Belpre eneeuting Tp Pt peeempts, and fo, comes, pp chek Ty (o==4) @ False thn enteutts Ip Ar au. tok= 4 ond ents In CS, Now, P, come ‘ g eceuted I, & stk Locke 1 (oveumte Lock vole ) wow, P, also enters {n cS, Both Prowsses au in C8 now. ve, there fe No quosouss Of Mutual excurson tH tis (ue |Tet _and set, instruction 7 pyar while (testand. set er) ie eatital settion Louk = = pose | ‘ oe ri oe beclean test_and. seb ( boolean » tenga) > T boolean ov = Hagel 5 3 4 she (touk= = 1) | Here, T, ord Ty combines 4 work = 15 cect ene instucbian Yn ery cede “5, er seaien Ne ee ne te one Li ake Oj Jest ase BQ then aut thy value fn one stu. 60, tha, premption wut not toke place \ by cuyauute, otk = ieee Lo kK te: rhe Le) Fi) while [ test_anol Set Ha yerwins False means co ompry sR wid eter Be 6S : AR, wu pot rote FA enden 9n cs und) PU tomplutet Ton Props | . 1000 “. Aciwed Mutual “OeTown Vosiable (siete auiennation metros) —— ohm > two paoeus sol” 5 un UseH Mode. _ Prous fo rout Pr jest while (tas | = 0) | hiv (twa | = 4) cs cs oy Toe 1 ‘ tus = 0, { snitiolly , gun tan be 0 OL, o qusuy= 0 then % n pe, wsill enero f, pu enter OUT fev fuun= 4, all tw twn-o , fo ws eeecrst x: his ews o) @& False g wh enter Tn cs Now, > alto wants +o enfen An C5, x1 wh (two |= 4) (o = 4) @ Te eo ceee tee loop, nk alowed to ent OP inp ena apis thi wmpltion of fe Mucdeal welusion dw, TH_ cue se ee empty cs i any P wonts ie, ue bak, wt xuppose €S bs empty ke tw.= 0 Now 1p, wants -fo orden bub at cont, why? use “hw = 4) (0}- © T pee @ cant enter 8n CS ountl Be get post. baz. ey fr ental S46 ext} caddy wll VERSE fons 4 get exited {x vie versa, oe uduMeant poe sn bees fe ty to wop Ph to ent tn CS, +6 pee teneept »
You might also like
Os Module 2 Theory
PDF
No ratings yet
Os Module 2 Theory
9 pages
Os Unit 2 Part 2
PDF
No ratings yet
Os Unit 2 Part 2
8 pages
Operating System Notes
PDF
No ratings yet
Operating System Notes
71 pages
Os Unit 2 Part 3
PDF
No ratings yet
Os Unit 2 Part 3
13 pages
Unit 2 Operating System Notes
PDF
No ratings yet
Unit 2 Operating System Notes
16 pages
Python question bank
PDF
No ratings yet
Python question bank
13 pages
OS.full notes
PDF
No ratings yet
OS.full notes
61 pages
DS Unit V Handwritten Notes
PDF
No ratings yet
DS Unit V Handwritten Notes
76 pages
DLCOA
PDF
No ratings yet
DLCOA
32 pages
queue-adt
PDF
No ratings yet
queue-adt
34 pages
PPS Unit 3
PDF
No ratings yet
PPS Unit 3
27 pages
C Language Notes
PDF
No ratings yet
C Language Notes
97 pages
C Programming Language
PDF
No ratings yet
C Programming Language
55 pages
C Programming
PDF
No ratings yet
C Programming
42 pages
Adobe Scan 04-Feb-2024
PDF
No ratings yet
Adobe Scan 04-Feb-2024
20 pages
unit31
PDF
No ratings yet
unit31
10 pages
DS File CS-203P
PDF
No ratings yet
DS File CS-203P
22 pages
C++ Part3
PDF
No ratings yet
C++ Part3
13 pages
TCS QB Solution
PDF
No ratings yet
TCS QB Solution
33 pages
Lab 2
PDF
No ratings yet
Lab 2
21 pages
C Programming
PDF
No ratings yet
C Programming
7 pages
Control Statement
PDF
No ratings yet
Control Statement
36 pages
Ss Lab Journal
PDF
No ratings yet
Ss Lab Journal
43 pages
Loop Questions
PDF
No ratings yet
Loop Questions
18 pages
c programming
PDF
No ratings yet
c programming
26 pages
Computer Science
PDF
No ratings yet
Computer Science
58 pages
4 Synchronizarion
PDF
No ratings yet
4 Synchronizarion
14 pages
Cs Notes
PDF
No ratings yet
Cs Notes
28 pages
TCS Basics and Theory Qna
PDF
No ratings yet
TCS Basics and Theory Qna
43 pages
VLSI Pradnya
PDF
No ratings yet
VLSI Pradnya
30 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
Python
PDF
No ratings yet
Python
28 pages
87中山資工考古
PDF
No ratings yet
87中山資工考古
8 pages
Os Banker's Algorithem
PDF
No ratings yet
Os Banker's Algorithem
15 pages
Dr. Vinay Trivedi_Lec04_UCS303_ENC456
PDF
No ratings yet
Dr. Vinay Trivedi_Lec04_UCS303_ENC456
3 pages
2 ControlFlow
PDF
No ratings yet
2 ControlFlow
93 pages
Image To PDF - 29092023 - 145058
PDF
No ratings yet
Image To PDF - 29092023 - 145058
33 pages
Computational Method Note
PDF
No ratings yet
Computational Method Note
30 pages
Important Topics
PDF
No ratings yet
Important Topics
12 pages
OS Notes
PDF
No ratings yet
OS Notes
214 pages
Computer Science & Engineering: A (Mark)
PDF
No ratings yet
Computer Science & Engineering: A (Mark)
8 pages
Data Structures and Algorithms Unit-2 Notes
PDF
No ratings yet
Data Structures and Algorithms Unit-2 Notes
24 pages
18CS752-Python 4
PDF
No ratings yet
18CS752-Python 4
16 pages
Lecture 9: Cri, Cal Sec, Ons Revisited and Reasoning About Programs
PDF
No ratings yet
Lecture 9: Cri, Cal Sec, Ons Revisited and Reasoning About Programs
23 pages
Os
PDF
No ratings yet
Os
38 pages
Unit 1 Flat
PDF
No ratings yet
Unit 1 Flat
32 pages
fsv slide
PDF
No ratings yet
fsv slide
104 pages
Data Structures Unit 1 - SVS
PDF
No ratings yet
Data Structures Unit 1 - SVS
21 pages
2025 QUIZ 408 MARKING
PDF
No ratings yet
2025 QUIZ 408 MARKING
8 pages
Critical Sections With Lots of Threads
PDF
No ratings yet
Critical Sections With Lots of Threads
34 pages
Gate ShortNotes
PDF
No ratings yet
Gate ShortNotes
22 pages
MPI Gtu Win. & Sum.2022
PDF
No ratings yet
MPI Gtu Win. & Sum.2022
65 pages
OS Assignments
PDF
No ratings yet
OS Assignments
11 pages
Artificial Intelligence
PDF
No ratings yet
Artificial Intelligence
45 pages
Dpco Assing 2
PDF
No ratings yet
Dpco Assing 2
17 pages
TAFL unit 5
PDF
No ratings yet
TAFL unit 5
10 pages
Adobe Scan Sep 06, 2024
PDF
No ratings yet
Adobe Scan Sep 06, 2024
30 pages
Lecture 3 - Branching and Iteration
PDF
No ratings yet
Lecture 3 - Branching and Iteration
26 pages
5 6080338295609361318
PDF
No ratings yet
5 6080338295609361318
2 pages
Unit 4 Part 2
PDF
No ratings yet
Unit 4 Part 2
13 pages
Unit 5 Os
PDF
No ratings yet
Unit 5 Os
28 pages
OS Unit 3 Part 3
PDF
No ratings yet
OS Unit 3 Part 3
21 pages
OS Unit 3 Part 2
PDF
No ratings yet
OS Unit 3 Part 2
17 pages
OS Unit 3 Part 1
PDF
No ratings yet
OS Unit 3 Part 1
17 pages
OS Unit 1 Part 2
PDF
No ratings yet
OS Unit 1 Part 2
12 pages