




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
ImportSettings:
BaseSettings:BrownstoneDefault
HighestAnswerLetter:D
MultipleKeywordsinSameParagraph:No
Chapter:Chapter7
MultipleChoice
1.Adeadlockedstateoccurswhenever.
A)aprocessiswaitingforI/Otoadevicethatdoesnotexist
B)thesystemhasnoavailablefreeresources
C)everyprocessinasetiswaitingforaneventthatcanonlybecausedbyanotherprocessin
theset
D)aprocessisunabletoreleaseitsrequestforaresourceafteruse
Ans:C
Feedback:7.1
Difficulty:Medium
zOnenecessaryconditionfordeadlockiswhichstatesthatatleastoneresourcemustbe
inanonsharablemode.
heholdandwait
A)mutualexclusion
B)
c)circularwait
D)nopreemption
Ar
:B
Feedback:7.2.1
Difficulty:Medium
3.Onenecessaryconditionfordeadlockis,whichstatesthataprocessmustbeholding
oneresourceandwaitingtoacquireadditionalresources.
A)holdandwait
B)mutualexclusion
C)circularwait
D)nopreemption
Ans:A
Feedback:7.2.1
Difficulty:Easy
4.Onenecessaryconditionfordeadlockis,whichstatesthataresourcecanbereleased
onlyvoluntarilybytheprocessholdingtheresource.
A)holdandwait
B)mutualexclusion
C)circularwait
D)nopreemption
Ans:D
Feedback:7.2.1
Difficulty:Easy
5.Onenecessaryconditionfordeadlockis,whichstatesthatthereisachainofwaiting
processeswherebyPoiswaitingforaresourceheldbyPi,PiiswaitingforaresourceheldbyP2,
andPniswaitingforaresourceheldbyPo.
A)holdandwait
B)mutualexclusion
C)circularwait
D)nopreemption
Ans:C
Feedback:7.2.1
Difficulty:Easy
6
AThewitnesssoftwareproductisa.
lock-orderverifierthatusesmutual-exclusionlockstoprotectcriticalsections
B\
)
czmodelertodevelopresourceallocationgraphs
driverthatcanbeusedtopreventmutualexclusionfornonsharableresources
D\
l
zimplementationofthebanker'salgorithmavailableformostoperatingsystems
Ans:A
Feedback:7.4.4
Difficulty:Medium
7
AInasystemresource-allocationgraph,.
adirectededgefromaprocesstoaresourceiscalledanassignmentedge
B\
)
zadirectededgefromaresourcetoaprocessiscalledarequestedge
c\
1
7adirectededgefromaprocesstoaresourceiscalledarequestedge
D\
JNoneoftheabove
Ans:C
Feedback:7.2.2
Difficulty:Medium
8.Acycleinaresource-allocationgraphis.
A)anecessaryandsufficientconditionfbrdeadlockinthecasethateachresourcehasmore
thanoneinstance
B)anecessaryandsufficientconditionfbradeadlockinthecasethateachresourcehasexactly
oneinstance
C)asufficientconditionforadeadlockinthecasethateachresourcehasmorethanonce
instance
D)isneithernecessarynorsufficientforindicatingdeadlockinthecasethateachresourcehas
exactlyoneinstance
Ans:B
Feedback:7.2.2
Difficulty:Difficult
9.Tohandledeadlocks,operatingsystemsmostoften,
A\
J
Zpretendthatdeadlocksneveroccur
B\
!
/useprotocolstopreventoravoiddeadlocks
c\
!
/detectandrecoverfromdeadlocks
Dx
—
7Noneoftheabove
Ans:A
Feedback:7.3
Difficulty:Medium
uA
JWhichofthefollowingstatementsistrue?
AX
)
/Asafestateisadeadlockedstate.
B\
—
/Asafestatemayleadtoadeadlockedstate.
c\
—
D/Anunsafestateisnecessarily,andbydefinition,alwaysadeadlockedstate.
Anunsafestatemayleadtoadeadlockedstate.
Ans:D
Feedback:7.5.1
Difficulty:Medium
11.Supposethattherearetenresourcesavailabletothreeprocesses.Attime0,thefollowing
dataiscollected.Thetableindicatestheprocess,themaximumnumberofresourcesneededby
theprocess,andthenumberofresourcescurrentlyownedbyeachprocess.Whichofthe
followingcorrectlycharacterizesthisstate?
ProcessMaximumNeedsCuiTentlvOwned
Po104
Pl31
P264
AX
I
/Itissafe.
B\
1
7Itisnotsafe.
\
cl
z
DThestatecannotbedetermined.
Itisanimpossiblestate.
Ans:B
Feedback:7.5.1
Difficulty:Difficult
12.Supposethatthereare12resourcesavailabletothreeprocesses.Attime0,thefollowing
dataiscollected.Thetableindicatestheprocess,themaximumnumberofresourcesneededby
theprocess,andthenumberofresourcescurrentlyownedbyeachprocess.Whichofthe
followingcorrectlycharacterizesthisstate?
ProcessMaximumNeedsCurrentlyOwned
Po1()4
Pl32
AP274
Itissafe.
Bx
)
czItisnotsafe.
Thestatecannotbedetermined.
D\
l
zItisanimpossiblestate.
Ans:A
Feedback:7.5.1
Difficulty:Difficult
13.Whichofthefollowingdatastructuresinthebanker*salgorithmisavectoroflengthm,
wheremisthenumberofresourcetypes?
AX
I
/Need
B\
l
czAllocation
DMax
Available
Ans:D
Feedback:7.5.3
Difficulty:Easy
14.Assumetherearethreeresources,Ri,R2,and/?3,thatareeachassigneduniqueinteger
values15,10,and25,respectively.Whatisaresourceorderingwhichpreventsacircularwait?
A)/?i,/?2,R3
B)R3,/?2,R\
C)R3,Ri,Ri
D)R2,Ri,R3
Ans:D
Feedback:7.4.4
Difficulty:Medium
15.Acouldbepreemptedfromaprocess.
A)mutexlock
B)CPU
C)semaphore
D)filelock
Ans:B
Feedback:7.4.3
Difficulty:Medium
Essay
16.Explainwhathastohappenforasetofprocessestoachieveadeadlockedstate.
Ans:Forasetofprocessestoexistinadeadlockedstate,everyprocessinthesetmustbe
waitingforaneventthatcanbecausedonlybeanotherprocessintheset.Thus,theprocesses
cannoteverexitthisstatewithoutmanualintervention.
Feedback:7.1
Difficulty:Medium
17.Describethefourconditionsthatmustholdsimultaneouslyinasystemifadeadlockisto
occur.
Ans:Forasetofprocessestobedeadlocked:atleastoneresourcemustremainina
nonsharablemode,aprocessmustholdatleastoneresourceandbewaitingtoacquireadditional
resourcesheldbyotherprocesses,resourcesinthesystemcannotbepreempted,andacircular
waithastoexistbetweenprocesses.
Feedback:7.2.1
Difficulty:Medium
18.Whatarethethreegeneralwaysthatadeadlockcanbehandled?
Ans:Adeadlockcanbepreventedbyusingprotocolstoensurethatadeadlockwillnever
occur.Asystemmayallowadeadlocktooccur,detectit,andrecoverfromit.Lastly,an
operatingsystemmayjustignoretheproblemandpretendthatdeadlockscanneveroccur.
Feedback:7.3
Difficulty:Medium
19.Whatisthedifferencebetweendeadlockpreventionanddeadlockavoidance?
Ans:Deadlockpreventionisasetofmethodsforensuringthatatleastoneofthenecessary
conditionsfordeadlockcannothold.Deadlockavoidancerequiresthattheoperatingsystembe
given,inadvance,additionalinformationconcerningwhichresourcesaprocesswillrequestand
useduringitslifetime.
Feedback:7.4
Difficulty:Medium
20.Describetwoprotocolstoensurethatthehold-and-waitconditionneveroccursinasystem.
Ans:Oneprotocolrequireseachprocesstorequestandbeallocatedallitsresourcesbeforeit
beginsexecution.Wecanimplementthisprovisionbyrequiringthatsystemcallsrequesting
resourcesforaprocessprecedeallothersystemcalls.Analternativeprotocolallowsaprocessto
requestresourcesonlywhenithasnone.Aprocessmayrequestsomeresourcesandusethem.
Beforeitcanrequestanyadditionalresources,however,itmustreleaseailtheresourcesthatitis
currentlyallocated.
Feedback:7.4.2
Difficulty:Medium
21.Whatisonewaytoensurethatacircular-waitconditiondoesnotoccur?
Ans:Onewaytoensurethatthisconditionneverholdsistoimposeatotalorderingofall
resourcetypes,andtorequirethateachprocessrequestsresourcesinanincreasingorderof
enumeration.Thiscanbeaccomplishedbyassigningeachresourcetypeauniqueintegernumber
todeterminewhetheroneprecedesanotherintheordering.
Feedback:7.4.4
Difficulty:Medium
22.Whatdoesaclaimedgesignifyinaresource-allocationgraph?
Ans:Aclaimedgeindicatesthataprocessmayrequestaresourceatsometimeinthefuture.
Thisedgeresemblesarequestedgeindirection,butisrepresentedinthegraphbyadashedline.
Feedback:7.5.2
Difficulty:Medium
23.Describeawait-forgraphandhowitdetectsdeadlock.
Ans:Ifallresourceshaveonlyasingleinstance,thenwecandefineadeadlock-detection
algorithmthatusesavariantoftheresource-allocationgraph,calledawait-forgraph.Weobtain
thisgraphfromtheresource-allocationgraphbyremovingtheresourcenodesandcollapsingthe
appropriateedges.Todetectdeadlocks,thesystemneedstomaintainthewait-forgraphand
periodicallyinvokeanalgorithmthatsearchesforacycleinthegraph.
Feedback:7.6.1
Difficulty:Medium
24.Whatfactorsinfluencethedecisionofwhentoinvokeadetectionalgorithm?
Ans:Thefirstfactorishowoftenadeadlockislikelytooccur;ifdeadlocksoccurfrequently,
thedetectionalgorithmshouldbeinvokedfrequently.Thesecondfactorishowmanyprocesses
willbeaffectedbydeadlockwhenithappens;ifthedeadlock-detectionalgorithmisinvokedfor
everyresourcerequest,aconsiderableoverheadincomputationtimewillbeincurred.
Feedback:7.6,3
Difficulty:Medium
25.Describetwomethodsforeliminatingprocessesbyabortingaprocess.
Ans:Thefirstmethodistoabortalldeadlockedprocesses.Abortingalldeadlockedprocesses
willclearlybreakthedeadlockcycle;however,thedeadlockedprocessesmayhavetobe
computedforalongtime,andresultsofthesepartialcomputationsmustbediscardedandwill
probablyhavetoberecomputedlater.Thesecondmethodistoabortoneprocessatatimeuntil
thedeadlockcycleiseliminated.Abortingoneprocessatatimeincursconsiderableoverhead,
since,aftereachprocessisaborted,adeadlock-detectionalgorithmmustbeinvokedtodetermine
whetheranyprocessesarestilldeadlocked.
Feedback:7.7.1
Difficulty:Medium
26.Namethreeissuesthatneedtobeaddressedifapreemptionisrequiredtodealwith
deadlocks.
Ans:First,theorderofresourcesandprocessesthatneedtobepreemptedmustbedetermined
tominimizecost.Second,ifaresourceispreemptedfromaprocess,theprocessmustberolled
backtosomesafestateandrestartedfromthatstate.Thesimplestsolutionisatotalrollback.
Finally,wemustensurethatstarvationdoesnotoccurfromalwayspreemptingresourcesfrom
thesameprocess.
Feedback:7.7.2
Difficulty:Medium
27.Describehowasafestateensuresdeadlockwillbeavoided.
Ans:Asafestateensuresthatthereisasequenceofprocessestofinishtheirprogramexecution.
Deadlockisnotpossiblewhilethesystemisinasafestate.However,ifasystemgoesfroma
safestatetoanunsafestate,deadlockispossible.Onetechniqueforavoidingdeadlockisto
ensurethatthesystemalwaysstaysinasafestate.Thiscanbedonebyonlyassigningaresource
aslongasitmaintainsthesy
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 技術(shù)服務(wù)轉(zhuǎn)讓協(xié)議
- 高速邊坡植草施工方案
- 建筑勞務(wù)擴(kuò)大分包合同
- 珠海自建房庭院施工方案
- 2025年文言文高中試題及答案
- 2025年業(yè)務(wù)運(yùn)營(yíng)類面試題及答案
- 2025年微積分上冊(cè)考試題及答案
- 基坑回填專項(xiàng)施工方案
- 平房墻體翻新施工方案
- 2025年特種線纜材料合作協(xié)議書(shū)
- 醫(yī)院環(huán)境衛(wèi)生學(xué)監(jiān)測(cè)和院感控制課件
- 二年級(jí)下冊(cè)美術(shù)說(shuō)課稿-第4課《我的愛(ài)心卡》浙美版
- 春天古詩(shī)模板
- 【小學(xué)數(shù)學(xué)教育中創(chuàng)新思維的培養(yǎng)探究7900字(論文)】
- JT-T-1199.1-2018綠色交通設(shè)施評(píng)估技術(shù)要求第1部分:綠色公路
- 酒店能耗分析報(bào)告
- 桃花紅杏花紅混聲合唱簡(jiǎn)譜
- DL-T995-2016繼電保護(hù)和電網(wǎng)安全自動(dòng)裝置檢驗(yàn)規(guī)程
- ICP備案網(wǎng)站建設(shè)方案書(shū)
- 《柔性棚洞防護(hù)結(jié)構(gòu)技術(shù)規(guī)程》
- 初中英語(yǔ)翻譯專題訓(xùn)練100題含答案
評(píng)論
0/150
提交評(píng)論