操作系统课件chapter6-deadlock.pptVIP

  • 17
  • 0
  • 约2.78万字
  • 约 97页
  • 2016-12-26 发布于贵州
  • 举报
Content of this lecture 6.1 Resources 6.2 Deadlock 6.3 Ostrich Algorithm 6.4 Deadlock Detection Deadlock Recovery 6.5 Deadlock Avoidance 6.6 Deadlock Prevention 6.7 Other Issues Summary Resources (1) Deadlocks may occur when … Processes are granted exclusive access to devices, files, and so forth. We refer to the objects granted as resources A resource is anything that can be used by a single process at any instant of time. Resource Types R1, R2, . . ., Rm CPU cycles, memory space, I/O devices ,record in a database… Each resource type Ri has Wi instances. Resources (2) Resources can be either: Reusable Resources Used by one process at a time and not depleted by that use Processes obtain resources that they later release for reuse by other processes E.g., CPU, memory, disk space, I/O devices, files, databases, semaphores. Acquire ? Use ? Release Consumable Resources Created (produced) and destroyed (consumed) by a process E.g., messages, buffers of information, interrupts. Create ? Acquire ? Use Resource ceases to exist after it has been used, so it is not released. Resources (3) Resources can also be either: Preemptible Resources Can be taken away from a process with no ill effects E.g., CPU, memory No deadlock Non-preemptible Resources One that cannot be taken away from its current owner without causing the computation to fail. Will cause the process to fail if taken away E.g., Tape Drives, CD Recorder Deadlock possible Resources (4) And resources can be either: Shared among several processes E.g., Read-only files Dedicated exclusively to a single process E.g., Printers Each process utilizes a resource as follows: Request the resource Use the resource Release the resource Must wait if request is denied Requesting process may be blocked May fail with error code Assume that when a process is denied a resource request, it is put to sleep. Resources (5) Processes need access to resources in reasonable order Suppose a process holds resource A (e.g.

文档评论(0)

1亿VIP精品文档

相关文档