操作系统精髓与设计原理英文pptChapter
Concurrency: Deadlock and Starvation Chapter 6 Deadlock Each process in a process group is waiting for some resource occupied by another process of the same group, so that every process of the group is in starvation Permanent blocking of a set of processes that either compete for system resources or communicate with each other No efficient solution Involve conflicting needs for resources by two or more processes Reusable Resources Used by only one process at a time and not depleted by that use Processes obtain resources that they later release for reuse by other processes Processors, I/O channels, main and secondary memory, devices, and data structures such as files, databases, and semaphores Deadlock occurs if each process holds one resource and requests the other Example of Deadlock Another Example of Deadlock Space is available for allocation of 200Kbytes, and the following sequence of events occur Deadlock occurs if both processes progress to their second request Consumable Resources Created (produced) and destroyed (consumed) Interrupts, signals, messages, and information in I/O buffers Deadlock may occur if a Receive message is blocking May take a rare combination of events to cause deadlock Example of Deadlock Deadlock occurs if receives are blocking Resource Allocation Graphs Directed graph that depicts a state of the system of resources and processes Resource Allocation Graphs Conditions for Deadlock Mutual exclusion Only one process may use a resource at a time Hold-and-wait A process may hold allocated resources while awaiting assignment of others No preemption No resource can be forcibly removed from a process holding it Conditions for Deadlock Circular wait a closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain consequence of the first three conditions Conditions for Deadlock Mutual Exclusion No preemption Hold and wait Circular wait Each of these four conditions is necessary,
原创力文档

文档评论(0)