operating-systems concurrency

Definition

Resource Types (Operating Systems)

In the context of deadlock analysis, the operating system distinguishes between two primary types of resources based on their lifecycle and usage patterns: renewable and consumable resources.

Renewable Resources

A renewable resource (or reusable resource) can be used by only one process at a time and is not depleted by that use. Processes follow a cycle of requesting the resource, using it, and then releasing it so that other processes can use it again.

  • Examples:
    • Hardware: CPU, main memory, I/O devices (disk drives, printers).
    • Software: Data structures like the Process Table, files, and databases protected by mutual exclusion.
  • Deadlock Potential: Deadlocks occur if a set of processes each hold some renewable resources and request others held by other processes in the set.

Consumable Resources

A consumable resource is one that is created (produced) and destroyed (consumed). There is no fixed total number of these resources in the system; they exist only until they are used.

  • Examples:
  • Deadlock Potential: Deadlocks occur if a process is waiting for a message (resource) that will never be sent by another process, which itself is blocked.

Visual Comparison