0% found this document useful (0 votes)
29 views15 pages

OS Unit-3

Uploaded by

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

OS Unit-3

Uploaded by

mahiyadav2585
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

JNTT-3

RkoceSS MAN A
GEMeN7 E VcRONIIAT

Csititical secti on
Dne prou af a dime
)s a
block of code. thab
an eocs etle So ohen ont proUs is
k cibca sociono olkr proutt may be in ik uikeal sen
The cailca seelion poblrm is to ensue that ony on prou
at ao dime itk allosed oto oputig ih ik ciltead sickion
ak
>eaiHa! Seelion is psoess may ahang Som lommon Valiabl.
OHingiau, updating memoy locuton,updatng a pog
-alse ek. sheo prousis aætesing Bhated modilyabl daa
is Coteod tbe
utca seohion,
Cach pous taees
to to enkr inb the cuhe
pornision rom oc Ho
seeion
shruetue o eiico sehon
enti sokors
Rsreinder CiHca
Section seelions
exil seeions

for enikring oitical sackion


Ch Renainder etion Rt th coo is Rimaindir 'sechor,
tach prouts Cyele thrOugb umaindr seation, enby teeiey
ciical seol'on Cit GechoFnt count
Prous Procs
CouN ount)
he Cuiica ectionep Count s6
upon leavt
prblem) peghn a prolocol o solve thi problum
sehon prblm The syskm shold
eniue tha ony po us ota ime Can ceut

Hh ihucta in ik uiea seeHon.stor a putao


1} One Prous Hemps to entr ik ait'a. secio
lt anoler is in is Own Caihcal cee Hon The fst pous Sloo
| the eeceu
g a prou in a cu'tical cehion can tamit by ony touor
sobaion c eaikcal scchion
()hcd do
to caiHeal c ion prblm musd sakisty the nu kal
ezeluvions proqress and boudo oaihy patamehn
->Mlued excheuicn: eh a tine only one ic being etcuko
pAocs in aiHool ection:
DOGress?) ont pous olocsn! tquie eui'tical section
thal pros ehoulal hol stop the other prolt t xecaik o
so& alo sol do cailical seation prblm is availab

domid s prepie non-potlaphve karhef


Stasdocon gpchrorisolion
Maney cyslero provids latolaoate Support to
Coot Cilital seetion

ani-procs fs pcthing but only on pOst0


ex laplop: pconal
Compu lkr
’uni-prouu to oizabl. inerreps
>uenty unnírg Cole colo eacale ofthout pu
emphon.
’Gunevally to Sneidenh mulli poUMO syshm
thie rot boadly Stalabk
>Moclon Missfo Machine oovoe Speeall
automie

lomonly eosulng oi2houl any Sntrruph P, om


tisest and &t cprcion
(B si0appíng Melhoel.
(lsiest and se
cpexaton't
sânql Sneiideual Mncbire Snstuition i it si
>In or tMachine Cuele S test to se S
an
are -the
# is sel Roo aun avai labf.T$< ky is orail
ae tHasceal,
c'ulion Hes Gorshyuelion Csifca Stckionprobum
Syntax

’ The ngyuelion adethe vale


o} 4 ohích moy ein,
-Lue o tale hen the valu ig Copied ioto P and irr
eet th valu ot q, is tsteee
’ he proes P, teat he
Condiicor code
btlore erleving silica! Secl'on. I no other pous
ADas io thic cHca! seckion then pouu wocld be
culous to proaeef and the eondiion codh boulel be
ehangd
’ bhor Prou P eait he cuilicel seckion yhe Conel:
Code is eset to o. So another pro e enr

Ke have doo mlhodgokerchongi the ralus

" usfrg t mp valu

volb s (toolor"a, hoelan%)


hrcuan terrp
a: b

-Lubr: choxd bolnn vaviatl lock iritialisrd to falr, ooch


peees soelion loy Mubeagut

do

Caflfcal seelfon
lock lalse;
Ruma[ncler seetion
Ceholebpatk
Dobltm)
1gbil (tru)
seMPARRée kg ie dleceibe d beDstra " olgoih.
-s a valiatole wyd ar aa lag :
-’ is a os abethrat data fype i takes cnly inliger
valus.usel to sole Cullleol seefior potlr
>Snaphoe Slyadue tioo Cpration (e and v)
o opevats Semephuue to solve
to sole the
the proes ynehrcn'salon
Protlim
A pouu cale the p opstaton oheo it le'anh to enke
in te the citfcas secticn anal calle r opelion when it
Qxit -tht itces ceetion,
> P opua'oo
opvatbn i alle d eignol opralin!
cpevtion Senophas deeraes ik valu
do loops
S:s-}
Sianad euat'on Snueoe the valua by 1
signo: S=s+1;
*classical
Dinng philecophel pobluro
Soaing philacophy pxioblem ie one o classiJ Prous!
senehonicatin problem Hete s philosophls ae Sealeo
aseund a ciyeuastable a spend thei lives fn thinkirg
a

an o eeting 5 plou wtth s Joske aHe kept on a cireu


s philocoph think theis gnost eting and dors
tqeuiste -loak. ohen philosopey deeideu to eat thenHe
ehe mut obtain Porky. 4 trom ltsideole. and
4 Fuco wight ticb tort. philosophen Can piceup a
only a singk Jok at a4ina

fo

-> After onturming a tood. tk philotophes stuplau the


anlecumes -thinking a philoophr to tbe eltor vig
philor ophw Cannot eat ohile the cdinniny
philoxophis Sine ores a a chaeo
ealing
bunr) (shauel
Coud
(prodourn.
) Coermenh Consumr
itey) derta ("Tele Bulle throm data
heandConsumr
Racl Bufer a in ihShors
dlatae qerats ayplicaorn a)-hon Pos eroduur
vauialbde oyticd bemay ci3e
lfurConsumer. and roducer blud ’Bebore
is
al
later Contumu
proes
s ro tonsu
mr Tlem elato produe prouss rodutr
aynchsonisation pdogo
lanical 'eJoaample
r is pobl onsumer ’poduor
problrn Contumer procderesr ci
utlorte put 3
eo, toputmigbt
rte
(ola; tocel Gal
(; lore right take
eaing votd
tort 3
2ight aohik4
cinloaf
Por| Ga Cinlcek
whilb tbinte.a Plloseph treue) 1ohile
-fork
(se hae 3 elat)

pai aly emply uler


soduer - Conemer ppobim
ajolty -th prodiri tondlition
produe- data ile ms cen
Produr Contunuy

Buller ult
cù ohen Ba ler is
ermpley Concumner must oalL
produur) Consum)
Cooilig)

dis Matuol. eaeluior.is stenud Jor aeeuning


the Butter
[prody |Consumey
SAsling gel of daa in d seelon o
Mimory oA
qenralliy labu somelina ancl ie putor ned
-though (pecHor o a seu ct pneHre operotio
oilead gion ik a pron shieh is eniie
adomplicationa iteo guoanti Nutoal
iien eion ata tinu
Cyskm to ensu prouss Cannot enkr
cutal
’ kach Concbiana erteal
a name and set of
rauials that can only be atemoi
drugh thetgjon
Sles-pxocese Comrmunicalior Mcbanitro
Ais tbe facility psovided by Pxo, -to
Commupicat With each othy'
>pro anolhs may be tunning
ommunicstirg oith onn anolhe
&fngle compatey os Mulliple Lompukue Connecteol to
a weteooxe.
KAceui ng Coneu MwenHy fn -the oc may be eith
ndapndirty ot o-opeMaiye poass

Cannot eleet o b efecteo by the othey ptourt

Co-opevotig pos:
Can elject on e led bey
elecleco by the oth pout
trueuing o the syehm is talled to-epeuating prouy
9dvantaqes o gect
eoay
these
b cke feut oto man
many ucene So fo ooe to
Co-optotive envitooment Use Dn actesr Al
sterostesc Concurtny
C9Compicotion
Con bt
spud} ohr enecuion ofa peulicula -tk
ividing vasieus Sub- tageSab-teuk Can be
esuoeskd poltely along voiih othott then e gek -the
high Compli cetional spd

Moderlay ADay bteaeing the sealem ) ppkeaton tuneont


iolo vajour sepatatr pots fn: Src
SPc ble poass Dn a sfnglCopput and dilkyen
syskm Sass Cormnpukri
acingle Compukrf
Kotnal
pOs P

-> fre -.Thelowo oPotrator blo too ptouSo &P


vía ketnal

eotnal

Protess
Prou
llow o snlosmation bleo to
puthpl keetnale. pe bo proctt
5 pitfeenl Melhode
J.piot 9. Fofo 3. 3emaphoa

.pire: Pips Cslabich îre shey ptovicle uni- diet hional


to» Caka pip: i ceetel. uing Pip, t) fenclion:
synlaz! nt eiee ( int Alt desp);
3h pipefcnction ekotn Aao"fite
descsiptoxs "sd[o
and tdf S fo decniplor cpened fo atading
-y d t1I i cptnd -fos oaking to the ipe
Dala douw -fsom Oot eod 'od pipe -to he abothir end
Beucces (o) erOr

prouss
euod ldto)
Qnd
end

o. FTPo-O is simila 4o the pípe. a ollee mote funetio


nalty than sfmpl. pipes do fpe. fIFO

ucing Menodle
Sqpla! Sr! Mkoocle (ehes * Pathname, in Mole, int der); B
name ol th FIFo
’Hint argumuo pathnamt apecily the
Mode peilin -thi dzis pexmitione (eadt,
lonie)enueuioa, pumision.
Dovieu Speilu tha not
Ofo.
onuido or
3 erna phoxe; g) allo vok MutHplk procssos Ho synchronise
>ema
theis eeceslion. Semapbose is a Memo locatlon who
Mote than on po
Ousue-Mest
poues to oite Mecsogagt Qeeceus lloas

a tMessag is iplernot
Messagei an eosti blo the, tesinel.
shaedMeinosg' chaud' Me mory ie
taski! Mocle Sr
alou the Muliple prouu a shae a Cornmon stgfon
Mancny.. Common pugfor o Memory mappd, cih
Vinbual -addes o eachjprouu.

caahang
eeat a
the d ale
Pipe -heo Calle
blo dilent 2OLISONS Aiea proy
foske) Senchon Cto cuat te
poc) to oteot a chilo proucs- this e a an SPC chen
blw the paen and ilo prous
stepefiredyparnt prous
ehiled po us

pipe

kune'
-Plo ol dao loinm uot to chilo
he paen! PAoceM cloes the end and .fel lo) the pipe
and the ehitel ppocs elose the Oile cnd tl13 o the
yire- similaty dos onL LCay fto q data -from chitdl to
pnut the child elese reacl enleL pios
pire ond paent loces
the KOtk end

patent Proess
chilol ocett

paseot protees
child pous
DPir
f lollooing program shoos how to ceate
pant to chilo and Lte ft to wiite apipe Hron
then ad the dake
ireluo <unistdh.
fot maine

int n, d(23

chas butH fuoog


cha Meg lioo] = 4e flo wod';

pinte ( can't eeat tte pipe );


hild pron

pit(nCas'! cteat a child "))


exeeulexecn to eee and jorle does nd pir cCeala
o 1).
prog boihin
a Commtrd shell
junehon. Pelore) d
ernd canalso
be it
call- sycey open uing opatiorn Paik
ojler
der) intoe,
int pathname, lchar Mknode Grt
Palhname, have
fih ohuos names path ha don Pips fiFO Cnd
nolhing i od Fifo
Oxoler the insead t it but
eodata
in FFo data,S floJo duplen) (taldizcioroJ
provide they pip" 'ramd Callud aleo ae FO
fI
fîFO asíng PC
))bul! ( of si , buto'} (Jd Mad ne
todj Lorik close *ohild (4dtn); elo
3
clsc:
Plre the toitk (Palen
y/end scad closk "paua to); (14 ex
cshdio.h
open(cench cha Shel cmol, tomt charoel)
>chell tomnand shellcomd i ahy
shel comd coodd be exeeeteed

tarolad
prcuss wik th datoa to th shandaue ole o

sdelesec ) tanchion

Jepen
yrlac!

Mosag shuchue F
taclude
shact megidds
permievio
shrut ipc pH Mg- peng; /"acocu He
shruet Msg
shue Msy s9-lavtj J poiner ko lant Me9

Pidt Mty tspid: (*pid e) last ntg sent


pid t MIg-trpid; /Pid e) law
LshrLchovt
9-sinuj

last

lonelu

You might also like