版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 音乐中音符英文术语
- 美国雇员退休收入保障法案(ERISA)探究
- 计算机应用基础复习题(答案)
- 2024年民营银行项目合作计划书
- 2024年低聚木糖项目合作计划书
- 人教版(2024)七年级上册数学 6.1 几何图形 同步教案
- 人教版七年级生物上册教案 3.5.1 光合作用吸收二氧化碳释放氧气
- 2024年跌落试验机项目合作计划书
- 人教A版(2019)高中数学选择性必修第三册 8.2《一元线性回归模型及其应用第3课时》教学设计
- 人教版五年级美术上册《第15课 神奇的装饰柱》教学设计
- 土木工程材料全套
- “自然宏”发酵型泡菜加工项目可行性研究报告
- 环保责任制度
- 商丘市食品工业发展规划
- -中药库房温度、湿度登记表新
- GB/T 19995.1-2005天然材料体育场地使用要求及检验方法第1部分:足球场地天然草面层
- DB42T 1958-2023 单轨道山地果园运输系统技术规程
- SRY基因检测及在性别鉴定中的应用 山东大学
- 混凝土用砂石质量及检验方法标准课件
- 2021年浙江浙能兰溪发电有限责任公司校园招聘笔试试题及答案解析
- ×××煤矿现场三大员管理考核办法
评论
0/150
提交评论