Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Lecture Operating system concepts (Sixth ed) - Chapter 8: Deadlocks. After studying this chapter you will be able to develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks; to present a number of different methods for preventing or avoiding deadlocks in a computer system. | Chapter 8 Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock Handling Operating System Concepts 8.1 Silberschatz Galvin and Gagne 2002 Bridge Crossing Example Traffic only in one direction. Each section of a bridge can be viewed as a resource. If a deadlock occurs it can be resolved if one car backs up preempt resources and rollback . Several cars may have to be backed up if a deadlock occurs. Starvation is possible. Operating System Concepts 8.3 Silberschatz Galvin and Gagne 2002 System Model Resource types R1 R2 . . . Rm CPU cycles memory space I O devices Each resource type Rị has W instances. Each process utilizes a resource as follows request use release Operating System Concepts 8.4 Silberschatz Galvin and Gagne 2002 Deadlock Characterization Deadlock can arise if four conditions hold simultaneously. Mutual exclusion only one process at a time can use a resource. Hold and wait a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption a resource can be released only voluntarily by the process holding it after that process has completed its task. Circular wait there exists a set P0 P1 . P0 of waiting processes such that P0 is waiting for a resource that is held by P1 P1 is waiting for a resource that is held by P2 . Pn_1 is waiting for a resource that is held by Pn and P0 is waiting for a resource that is held by P0. Operating System Concepts 8.5 Silberschatz Galvin and Gagne 2002 Resource-Allocation Graph A set of vertices V and a set of edges E. V is partitioned into two types P P1 P2.Pn the set consisting of all the processes in the system. R R1 R2.Rm the set consisting of all resource types in the system. request edge - directed edge P1 Rj assignment edge - directed edge Rj Pi Operating System Concepts 8.6 Silberschatz Galvin and Gagne 2002