欢迎来到天天文库
浏览记录
ID:57016424
大小:1011.00 KB
页数:58页
时间:2020-07-26
《操作系统精髓与设计原理课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Concurrency:DeadlockandStarvationChapter6Outline6.1PrincipleofDeadlock6.2Deadlockprevention(死锁预防)6.3Deadlockavoidance(死锁避免)6.4Deadlockdetection(死锁检测)6.1PrincipleofdeadlockDefinition:PermanentblockingofasetofprocessesthateithercompeteforsystemresourcesorcommunicatewitheachotherNoefficientsol
2、utionInvolveconflictingneedsforresourcesbytwoormoreprocesses1、ReusableResourcesUsedbyoneprocessatatimeandnotdepleted(消耗掉)bythatuseProcessesobtainresourcesthattheylaterreleaseforreusebyotherprocessesProcessors,I/Ochannels,mainandsecondarymemory,files,databases,andsemaphoresDeadlockoccursifea
3、chprocessholdsoneresourceandrequeststheotherExampleofDeadlock,D&TAnotherExampleofDeadlockSpaceisavailableforallocationof200Kbytes,andthefollowingsequenceofeventsoccurDeadlockoccursifbothprocessesprogresstotheirsecondrequestP1......Request80Kbytes;Request60Kbytes;P2......Request70Kbytes;Requ
4、est80Kbytes;2、ConsumableResourcesCreated(produced)anddestroyed(consumed)byaprocessInterrupts,signals,messages,andinformationinI/ObuffersDeadlockmayoccurifaReceivemessageisblockingMaytakeararecombinationofeventstocausedeadlockExampleofDeadlockDeadlockoccursifreceiveisblockingP1......Receive(
5、P2);Send(P2,M1);P2......Receive(P1);Send(P1,M2);3、ResourceAllocationGraphsDirectedgraphthatdepictsastateofthesystemofresourcesandprocessesResourceAllocationGraphs4、ConditionsforDeadlockMutualexclusion(互斥—排它性访问资源)onlyoneprocessmayusearesourceatatimeHold-and-wait(占有且等待—拥有部分资源,还要请求新的)Aprocessd
6、oesnotrequestallofitsrequiredresourcesatonetimeConditionsforDeadlockNopreemption(非剥夺性—排他性访问资源)Ifaprocessholdingcertainresourcesisdeniedafurtherrequest,thatprocessmustnotreleaseitsoriginalresourcesIfaprocessrequestsaresourcethatiscurrentlyheldbyanotherprocess,theoperatingsystemisnotallowedto
7、preemptthesecondprocessandrequireittoreleaseitsresourcesConditionsforDeadlockCircularwait(循环等待—在进程资源图中有环路)PossibilityofDeadlockMutualExclusionNopreemptionHoldandwaitExistenceofDeadlockMutualExclusionNopreemptionHoldandwaitCircularwaitNecessarycondition6.
此文档下载收益归作者所有