- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Detection-Algorithm Usage When, and how often, to invoke depends on: How often a deadlock is likely to occur? How many processes will need to be rolled back? one for each disjoint cycle If detection algorithm is invoked arbitrarily, there may be many cycles in the resource graph and so we would not be able to tell which of the many deadlocked processes “caused” the deadlock. Recovery from Deadlock: Process Termination Abort all deadlocked processes. Abort one process at a time until the deadlock cycle is eliminated. In which order should we choose to abort? Priority of the process. How long process has computed, and how much longer to completion. Resources the process has used. Resources process needs to complete. How many processes will need to be terminated. Is process interactive or batch? Recovery from Deadlock: Resource Preemption Selecting a victim – minimize cost. Rollback – return to some safe state, restart process for that state. Starvation – same process may always be picked as victim, include number of rollback in cost factor. Combined Approach to Deadlock Handling Combine the three basic approaches prevention avoidance detection allowing the use of the optimal approach for each of resources in the system. Partition resources into hierarchically ordered classes. Use most appropriate technique for handling deadlocks within each class. Summary 死锁:一组进程是死锁的,该组中的每一个进程正在等待这组中其他进程占有的资源时可能引起的一种错误现象。 死锁产生的原因 根本原因,系统资源不足 进程推进顺序不当 死锁产生的必要条件 互斥,占有和等待,不可剥夺,循环等待 死锁处理策略 忽略不计 预防,设法破坏四个必要条件 避免 为进程分配资源时,每当完成分配后,立即检查系统是否处于安全状态,若是,分配成功,否则,分配作废,让其阻塞等待 资源分配图算法、银行家算法 需要进程对资源需求的先验知识 设法找到一种安全的进程执行序列 检测与恢复 采用资源动态分配算法,当进程请求分配资源时,只要系统有可用资源就满足,系统定期启动死锁检测算法,检查是否有环(进程等待图) 作业 1. Consider the traffic deadlock depicted in following Figure. a. Show that the four necessary conditions for deadlock indeed hold in this example. b. State a simple rule that will avoid deadlocks in this system. 2. In a real computer system, neither the resources available nor the demands of p
文档评论(0)