操作系统概念英文课件:Chapter 7 Deadlocks.pptVIP

  • 8
  • 0
  • 约1.47万字
  • 约 68页
  • 2020-12-30 发布于安徽
  • 举报

操作系统概念英文课件:Chapter 7 Deadlocks.ppt

Operating System Concepts 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? Operating System Concepts 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. Operating System Concepts 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. Operating System Concepts Partition resources into hierarchically ordered classes. Use most appropriate technique for handling deadlocks within each class. Operating System Concepts Traffic Deadlock for Exercise 8.4 Operating System Concepts Operating System Concepts Unsafe State In Resource-Allocation Graph Operating System Concepts Banker’s Algorithm Multiple instances. Each process must a priori claim maximum use. Operating System Concepts When a process requests a resource it may have to wait. When a process gets all its resources it must return them in a finite amount of time. Operating System Concepts Data Structures for the Banker’s Algorithm Available: Vector of length m. If available [j] = k, there are k instances of resource type Rj available. Max: n x m matrix. If Max [i,j] = k, then process Pi may request at most k instances of resource type Rj. Let n = number of processes, and m = number of resources types. Operating System Concepts Allocation: n x m matrix. If Allocation[i,j] = k then Pi is currently allocated k instances of Rj. Need: n x m matrix. If Need[i,j] = k, then Pi may need k more instances of Rj to complete its task. Need [i,j] = Max[

文档评论(0)

1亿VIP精品文档

相关文档