欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    操作系统 ppt6.ppt

    • 资源ID:87334427       资源大小:613KB        全文页数:52页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    操作系统 ppt6.ppt

    Concurrency:Deadlock(死锁)and Starvation(饥饿)Chapter 616.1 Principles of Deadlock6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary2DeadlockPermanent blocking of a set of processes that either compete for system resources or communicate with each otherNo efficient solutionInvolve conflicting(冲突)needs for resources by two or more processes3456Resources Categories(资源的分类)Reusable Resources(可重用资源)Consumable Resources(可消费资源)76.1 Principles of Deadlock6.1.1 Reusable Resources6.1.2 Consumable Resources6.1.3 Resource Allocation Graphs6.1.4 The Conditions for Deadlock8Reusable Resources(可重用资源)Used by only one process at a time and not depleted(耗尽)by that useProcesses obtain resources that they later release for reuse by other processesProcessors,I/O channels,main and secondary memory,devices,and data structures such as files,databases,and semaphoresDeadlock occurs if each process holds one resource and requests the other9Example of DeadlockInterleaves the execution:p0 p1 q0 q1 p2 q210Another Example of DeadlockSpace is available for allocation of 200Kbytes,and the following sequence of events occurDeadlock occurs if both processes progress to their second requestP1.Request 80 Kbytes;Request 60 Kbytes;P2.Request 70 Kbytes;Request 80 Kbytes;116.1 Principles of Deadlock6.1.1 Reusable Resources6.1.2 Consumable Resources6.1.3 Resource Allocation Graphs6.1.4 The Conditions for Deadlock12Consumable Resources(可消费资源)Created(produced)and destroyed(consumed)Interrupts,signals,messages,and information in I/O buffersDeadlock may occur if a receive message is blockingMay take a rare combination of events to cause deadlock(很少的事件组合也可能导致死锁)13Example of DeadlockDeadlock occurs if receive is blockingP1.Receive(P2);Send(P2,M1);P2.Receive(P1);Send(P1,M2);146.1 Principles of Deadlock6.1.1 Reusable Resources6.1.2 Consumable Resources6.1.3 Resource Allocation Graphs6.1.4 The Conditions for Deadlock15Resource Allocation Graphs(资源分配图)Directed graph(有向图)that depicts(表述)a state of the system of resources and processes16Resource Allocation Graphs176.1 Principles of Deadlock6.1.1 Reusable Resources6.1.2 Consumable Resources6.1.3 Resource Allocation Graphs6.1.4 The Conditions for Deadlock18Conditions for Deadlock(死锁的条件)Mutual exclusion(互斥)Only one process may use a resource at a timeHold-and-wait(占有且等待)A process may hold allocated resources while awaiting assignment of othersNo preemption(非抢占)No resource can be forcibly removed form a process holding it19Conditions for DeadlockCircular wait(循环等待)A closed chain of processes exists,such that each process holds at least one resource needed by the next process in the chain20Possibility of DeadlockMutual ExclusionHold and wait No preemption21Existence of DeadlockMutual ExclusionHold and waitNo preemptionCircular wait22Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary23Deadlock Prevention(死锁预防)Mutual ExclusionMust be supported by the operating systemHold and WaitRequire a process request all of its required resources at one time24Deadlock PreventionNo PreemptionProcess must release resource and request againOperating system may preempt a process to require it releases its resourcesCircular WaitDefine a linear ordering of resource types25Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary26Deadlock Avoidance(死锁避免)A decision is made dynamically whether the current resource allocation request will,if granted,potentially lead to a deadlockRequires knowledge of future process request27Two Approaches to Deadlock AvoidanceDo not start a process if its demands might lead to deadlock(如果一个进程的请求会导致死锁,则不启动此进程,资源启动拒绝)Do not grant an incremental resource request to a process if this allocation might lead to deadlock(如果一个进程增加资源的请求会导致死锁,则不容许此分配,资源分配拒绝)28Resource Allocation DenialReferred to as the bankers algorithmState of the system(系统状态)is the current allocation of resources to processSafe state(安全状态)is where there is at least one sequence that does not result in deadlockUnsafe state(不安全状态)is a state that is not safe29Determination of a Safe StateInitial State30Determination of a Safe StateP2 Runs to Completion31Determination of a Safe StateP1 Runs to Completion32Determination of a Safe StateP3 Runs to Completion33Determination of an Unsafe StateP1 request for one additional unit each of R1 and R334Determination of an Unsafe State35Deadlock Avoidance Logic(死锁避免逻辑)36Deadlock Avoidance Logic37Restrictions of Deadlock AvoidanceMaximum resource requirement must be stated in advanceProcesses under consideration must be independent;no synchronization requirementsThere must be a fixed number of resources to allocateNo process may exit while holding resources38Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary39Deadlock DetectionReference P.273 of the textbook for deadlock detection algorithm40Strategies Once Deadlock DetectedAbort all deadlocked processesBack up each deadlocked process to some previously defined checkpoint,and restart all processOriginal deadlock may occurSuccessively abort deadlocked processes until deadlock no longer existsSuccessively preempt resources until deadlock no longer exists41Selection Criteria Deadlocked ProcessesLeast amount of processor time consumed so farLeast number of lines of output produced so farMost estimated time remainingLeast total resources allocated so farLowest priority42Strengths and Weaknesses of the Strategies43Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary44An Integrated Deadlock Strategy(一种综合死锁策略)Group resources into a number of different resource classesUse the linear ordering strategy defined previously for the prevention of circular wait to prevent deadlocks between resource classesWithin a resource class,use the algorithm that is most appropriate for that class45Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary46Dining Philosophers Problem(哲学家就餐问题)47Dining Philosophers Problem(incorrect)48Dining Philosophers Problem49Dining Philosophers Problem50Agenda6.1 Principles of Deadlock6.2 Deadlock Prevention6.3 Deadlock Avoidance6.4 Deadlock Detection 6.5 An Integrated Deadlock Strategy6.6 Dining Philosophers Problem6.7 Summary51HomeworkReview Questions:6.26.3Problems:6.46.552

    注意事项

    本文(操作系统 ppt6.ppt)为本站会员(asd****56)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开