chapter6 操作系统概要1
该图是对死锁现象的一种非形式的说明,横轴和纵轴分别表示进程P和进程Q的进展(用完成的指令条数来度量)。 从该空间的原点开始的任何一条阶梯形折线为二进程的共同进展路径,这条进展路径只能前进,因为指令的执行是不能倒退的。 Unsafe state is not a deadlocked state. * Deadlock Detection with Multiple Resources of Each Type (5) Example: Deadlock Detection with Multiple Resources of Each Type (6) For example( E,A,C,R are as shown): First, there are 2 first resources,1 second resource (see A), so, only the third one can be satisfied; so the third process go get resources and executes and then release all its resources, so giving A=(2 2 2 0)=(0+2,1+1,2+0,0+0) At this point, process 2 can run and return its resources ,so, A=(4 2 2 1) Now, the remaining process can run, there is no deadlock E=(4 2 3 1) 0 0 1 0 2 0 0 1 0 1 2 0 2 0 0 1 1 0 1 0 2 1 0 0 C= R= A=(2 1 0 0) 6.4.3 Recovery from Deadlock 死锁恢复的方法Recovery from Deadlock 剥夺法恢复Recovery through preemption 临时将某些资源从其持有者手里转移到另一个进程中 往往需要人工干预 回退法恢复Recovery through rollback 如果死锁行为都类似 为进程设置检查点checkpoint,将进程的状态写入特定文件中以备重启:memory image、resource state 周期地对进程进行检查 杀死进程来恢复Recovery through killing processes 一种是杀死环中的某个进程:不能保证死锁的解除 一种是杀死环外的某个进程 原则是尽量杀死不重要或可重复执行不带副作用的进程 6.4.3 Recovery from Deadlock 1. Recovery through preemption In some cases it may be possible to temporarily take a resource away from its current owner and give it to another process. 2. Recovery through rollback (回滚) The system designers and machine operators can arrange to have processes checkpointed periodically. Checkpointing a process means that its state is written to a file so that it can be restarted later. 6.4.3 Recovery from Deadlock When a deadlock is detected, it is easy to see which resources are needed. To do the recovery, a process that owns a needed resource is rolled back to a point in time before it acquired that resource by starting one of its earlier checkpoints. 3. Recovery through killing processes The crudest way to break a deadlock is to kill one or more processes. One possibility is to kill a process in the cycle. A process not in the cycle ca
您可能关注的文档
- Chapter two Cultural differences翻译第二章课件(西安石油大学)概要1.ppt
- Chapter+12现代语言学流派概要1.ppt
- Chapter Ⅴ概要1.ppt
- Chapter02 The CPA Profession(审计学英文版)概要1.ppt
- Chapter02_SQL详解概要1.ppt
- Chapter 5偏晶概要1.ppt
- Chapter03 Accounting Cycle (II) Adjustments, Work Sheet and Financial Statements基础会计英文版概要1.ppt
- Chapter03 Audit Reports(审计学英文版)概要1.ppt
- Chapter03电子表格建模的艺术概要1.ppt
- Chapter 9 Internet Marketing 网络市场概要1.ppt
最近下载
- 抗肿瘤药物静脉给药技术规范与实践.pptx
- coc模组翻译降临-adventus regis.pdf VIP
- 2025年02月定向淄博届公费医学毕业生选岗考试笔试历年专业考点(难、易错点)附带答案详解 .doc
- 初中七年级语文暑假阅读理解专项训练-记叙文篇(含答案).docx
- 八人制足球竞赛规则介绍-足球竞赛规则.pdf VIP
- 4000重要英文词汇4000EEW3_Word List_ENG.pdf VIP
- 档案管理保密笔试题及答案.docx VIP
- 2025(更新)中国围透析期慢性肾脏病管理临床实践指南(2025年版)解读课件.pptx VIP
- 建筑初步课程.ppt VIP
- 特定技能号农业练习题附有答案.docx VIP
原创力文档

文档评论(0)