operating-systems concurrency

Definition

Indirect Deadlock Prevention

Indirect deadlock prevention prevents deadlocks by invalidating one of three system-level Coffman conditions: Mutual Exclusion, Hold and Wait, or No Preemption.

Strategies

Break Mutual Exclusion

Some resources (e.g., printers) cannot be shared directly. Spooling makes non-shareable resources appear shareable by queuing requests in a buffer.

Break Hold and Wait

A process must request all resources at once and is blocked until all can be granted simultaneously.

Costs:

  • Resources held longer than needed
  • Process must know total requirements in advance
  • Starvation possible for processes requiring many resources

Break No Preemption

The OS may forcibly reclaim resources from processes.

Process-initiated: If a request is denied, the process releases all current resources and retries.

OS-initiated: If process requests a resource held by blocked process , the OS may preempt and reassign its resources.

Feasibility: Only practical for savable/restorable resources like CPU (context switching) or memory.