You are on page 1of 9

Date :

Opexuthng Syslen
Assigonen
Ecpleun paduce conauneA pAOblem
Semuphonae suBe -pseudo codeo the gme.
lelaso kooco CIa hoúnded biffe paoblem

PsiOduceAH pAaduce InfeAmelton & pul soto buffe


Con@ume thus Infemeihon
The psoblemS to nake Dure Ahal he paoducey
daha nto the bulfeA
coa
MOye buffes
Paaduces ConaumeA ptoblem ng Semaphoe
# Aefine N4
mutex
Hypeder nl semeiphoAe
SeMaph0e. mutexli
Semapho.He full 0;

cshile clue) Nems


tem1
Hem pocdcelem)
paoduces ufen
doan. c& mulex); TAen1
Anseatilern cilem):
up (& mulez), 3

upc&sull),
APURA)
Date :

yod Conamey (vond) muler

eehleue)
donc&mlex);
tem stemoveMemcHem);
up(&mute
upcé emph
Conoimeilemchem pIoducenbuffen

Code
pHocuce
Condrnes

poeluce tem eshilectsiue)


cacal cemp
eoch (reulesc sHemoye dem Hombuffes
da tem to buffes Signed emulex)
Signad cmuBex
Sgna) cfutl) eongymeeo.
Date:

2Ecplcug the Baakex's algoathn t deadlock wadance


pAocesses Allocaton HAX Available

Po 433
PL 2:2

15 3
Py 2
a Caleuleate the eooleot' of the neee calo
b cbeck f 4he Safe slaBe ?
sgalem 1S

The Banker's ctlgoathm ellocatons


Jdead lock CIYOIdance
cilgaALhm he1l esls te Dafel
Sumulatng the clloceton n the paedelesronne
Lmxpossble mou of allH9OuHCE Ahenockes cin
check to test en pos51kle esvties befose.
cleriding heite calloccton sheutd be allacsedto eeginaLe.
NeeAlijl max Alloc)hon [141
Need AgC

Po
P
Pa
Pa 133

appngsulehy-clgoth on
Wosk Available
Woak o

Fintsh alae iataelfalelFalal falae

Needo
EinshCo
3
talae Nee Nezk
So p mual Dait

Need 1:O

Sop, mual be n Mee Aequence


Nek Wek Allocationg
332+
Wezk 5 4

Need
hene
So Pa mual be in qeye segerce

5*4 4 + 4 O
q 4 5
Ropal Eco
APURA
LEinish :lEalaeTueltsue Fataelredac

Needa&13 3
hene
P mial be Dehe seguence

TetuelTouel Tyue

Needi
SO be Aente sequente.

Falac 2

Neel
here Neeslo dezk
So po must be

WWenk Alocaton
HAPURA) Bopal eco
Iraeltueltuelizue tsue

Hense he
The Sule Sequente l

3 Disk Hequests come Lntothedusk dven


daivex
in thal erden
yeqlader
5eek
takes G msec Cylincder moved. Houmuch se ek
pe
tme LS neelt fCES
cyluncder.
SSTF_ SCAN CSCAN LOOKnd
CLOOK alqoathms Ia cll ceses ihe
at cylinden LS Initall
To caleulade, the seek tirnies eReh clisk' schedülng
|algogHhm cFCES SSTE SCAN, cSCAN ookr & c00k)
ae need to Simulcate the DoV emeotfhe duse cm
& Su the -Qeek me each Heguest.
FcES
9SSIE
6C120-2ot lno 12l+l19 -sl+l6-6l+ 16-28) +l2s-26l+1as-4o)

SCAN

420 msec

4 cScAN (Cstcule Scan)

Y68 MSeC

5. Look
6120-281 +l9g8k| t:l38.-4ol+ l4o-2l l12+6ltl6-sltls-ia)

420 mSec

6. CLook C1CUlc Look)


620-28t128-38 + f3 -4o| t 140-S\ l5-6 l6-12l +li2-nolt
190-3sl)

APURA) 528 mSec. Ropal Eco


4vea
4
memo peuttons
k600' K8 cta des)kas douldeuch of thê
best id place
212 k

hechclgetha nakes the

psoceSS alak i s n t o pasl1hon


poceS 413ki ts pottan
poceS kits into
P.tocess 426ki does oo Ad 1oto

ges id
psoces 41 kits lnto600 k8 puthten
tpaocesS 12 k: ttsunto
Jpoces 42e k: its Into E609 KA punhthon.

pAocegS. 212k: ads into so0 KA poothhon.


ts nto s00 k8 pootthen
496 K ts 4ato SO0 ke peenttien

4n tenm o e7tcAeac the best tl algeuthn makes the.


ecient se
ntetnseqneotchtan thet Can ccommolade each
5.A
Gysien. paqe 4ames fe sloaunq paocess paaes
the lecst Recent Usee c0RU)
Assune Hoat call the paqe ame
page acplacemeat paliet lhat Ls the
nhally emply tolc 0umbes of

ults Beeus stale. Ahe pag


nelenence shung aven belo

To celeulete the Actel numbes ohpaqe tyed toulls sIg


the LRU paqe eplucemeal polcy eesimulde the
menteang
&
tckig

nen thet thene


scletence ag
Lel's Ahe peue selenence sAaung & Simulate.
|the teplacemesl palia
4 [4J. peqe eult

L: , 6]puge fcutt 4
cdaeeaetn meme)
eall claeed meme
cieudy in mene
aluendt
SO the tod cel numbet ults thet
e pege keualis thet ll oc
shele pocesing Hhe pcae siefetene stg i s.

You might also like