版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年高中生物 第1章 人體的內(nèi)環(huán)境與穩(wěn)態(tài) 第1節(jié) 細(xì)胞生活的環(huán)境教學(xué)實(shí)錄 新人教版必修3
- 開學(xué)典禮的演講稿(匯編15篇)
- 會(huì)計(jì)專業(yè)自我鑒定
- 以安全為主題的演講稿800字7篇
- 內(nèi)蒙古鄂爾多斯市東勝區(qū)九年級(jí)化學(xué)下冊 第六章 金屬 6.2 金屬的化學(xué)性質(zhì)(2)教學(xué)實(shí)錄 (新版)粵教版
- 2023八年級(jí)語文上冊 第四單元 寫作 語言要連貫教學(xué)實(shí)錄 新人教版
- 五年級(jí)信息技術(shù)上冊 第一課《計(jì)算機(jī)的軟件》教學(xué)實(shí)錄 川教版
- 水滸傳每一章的書筆記200字
- 個(gè)人簡單辭職報(bào)告十篇格式
- 羈押人員注意事項(xiàng)
- 程瑤-嬰幼兒蚊蟲咬傷課件講解
- 2024年長沙電力職業(yè)技術(shù)學(xué)院單招職業(yè)技能測試題庫附答案
- 美學(xué)導(dǎo)論智慧樹知到期末考試答案章節(jié)答案2024年山東工藝美術(shù)學(xué)院
- 2024年紀(jì)檢監(jiān)察綜合業(yè)務(wù)知識(shí)題庫及完整答案(歷年真題)
- 裝修設(shè)計(jì)招標(biāo)評(píng)標(biāo)辦法
- 培訓(xùn)課件 -華與華-產(chǎn)品開發(fā)超級(jí)案例課:8大產(chǎn)品開發(fā)案例 詳細(xì)講解華與華產(chǎn)品開發(fā)的原理、模型及技巧
- 乒乓球校隊(duì)選拔方案
- 熱水供水系統(tǒng)運(yùn)營維護(hù)服務(wù)投標(biāo)方案(技術(shù)方案)
- 現(xiàn)實(shí)與理想-西方古典繪畫 課件-2023-2024學(xué)年高中美術(shù)人美版(2019)美術(shù)鑒賞
- 模糊決策培訓(xùn)課件教案模板
- 快遞安全教育培訓(xùn)課件
評(píng)論
0/150
提交評(píng)論