版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年高中生物 第1章 人体的内环境与稳态 第1节 细胞生活的环境教学实录 新人教版必修3
- 开学典礼的演讲稿(汇编15篇)
- 会计专业自我鉴定
- 以安全为主题的演讲稿800字7篇
- 内蒙古鄂尔多斯市东胜区九年级化学下册 第六章 金属 6.2 金属的化学性质(2)教学实录 (新版)粤教版
- 2023八年级语文上册 第四单元 写作 语言要连贯教学实录 新人教版
- 五年级信息技术上册 第一课《计算机的软件》教学实录 川教版
- 水浒传每一章的书笔记200字
- 个人简单辞职报告十篇格式
- 羁押人员注意事项
- 2024年纪检监察综合业务知识题库及完整答案(历年真题)
- 装修设计招标评标办法
- 培训课件 -华与华-产品开发超级案例课:8大产品开发案例 详细讲解华与华产品开发的原理、模型及技巧
- 乒乓球校队选拔方案
- 热水供水系统运营维护服务投标方案(技术方案)
- 现实与理想-西方古典绘画 课件-2023-2024学年高中美术人美版(2019)美术鉴赏
- 模糊决策培训课件教案模板
- 快递安全教育培训课件
- 混凝土搅拌站安全操作规程技术交底培训
- 陵水黎族自治县食品公司椰林屠宰场生猪定点屠宰项目环评报告
- 迎新年卡拉OK比赛主持词
评论
0/150
提交评论