资源描述:
《操作系统概念(英文)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter7DeadlocksAnIntroductiontoChapter7(Twoparts)Resource-allocationandDeadlockconceptsofdeadlocksresource-allocationmodels(§7.1)necessaryconditionsfordeadlock(§7.2.1)descriptionsofresource-allocation(§7.2.2)Methodologiesofdeadlockhandling(algori
2、thms)principles(§7.3)deadlockprevention(§7.4)deadlockavoidance(§7.5)deadlockdetection-recovery(§7.6,§7.7)Exercises!November20132OperatingSystemConcepts-Chapter7Deadlocks-7.0ConceptsofDeadlockDefinitionasituationorsystemstatesinwhichasetofblockedproce
3、sseseachholdingaresourceandwaitingtoacquirearesourceheldbyanotherprocessintheset,andtheseprocesseswillneverproceed.E.g.1therearetwotapedriversAandBinthesystemP1andP2eachholdonetapedriveandeachneedsanotherone.semaphoresAandBcorrespondingtotwotapedrive
4、rsrespectively,initializedto1P1P2wait(A);wait(B)wait(B);wait(A)November20133OperatingSystemConcepts-Chapter7Deadlocks-P1P2ABholdsAwaitsforAFig.0.1DeadlockConceptConceptsofDeadlock(cont.)holdsBwaitsforBNovember20134OperatingSystemConcepts-Chapter7Dead
5、locks-E.g.2BridgeCrossingConceptsofDeadlock(cont.)Fig.7.0.2November20135OperatingSystemConcepts-Chapter7Deadlocks-trafficonlyinonedirection.eachsectionofabridgecanbeviewedasaresource.ifadeadlockoccurs,itcanberesolvedifonecarbacksup(preemptresourcesan
6、drollback).severalcarsmayhavetobebackedupifadeadlockoccurs.starvationispossible.RefertoAppendix7.AformoredetailsaboutformaldescriptionsofdeadlocksConceptsofDeadlock(cont.)November20136OperatingSystemConcepts-Chapter7Deadlocks-§7.1SystemModelSystemmod
7、elresource-allocationmodelFinitenumberofresourcesinsystems,resourcetypesR1,R2,...,Rmphysicalresources,e.g.,CPUcycles,memoryspace,I/Odeviceslogicalresources,e.g.,files,semaphores,monitorsEachresourcetypeRihasWiinstances,anumberofcompetingprocessesrequ
8、esttheinstancesofresourcetypes.Eachprocessutilizesaresourceasfollows:request(asasystemcall,inqueueofblockedprocesseswaitingfortheresource)userelease(asasystemcall)November20137OperatingSystemConcepts-Chapter7Deadlocks-Ifresourcesarecontrolledbysemaph