liveBook · Manning

Wait-for condition

As explained in Learn Concurrent Programming with Go

The wait-for condition is a deadlock condition in which an execution holding resources can request additional resources.

A wait-for condition exists when an execution already holding one or more resources requests additional resources. It is one of four conditions required for deadlock, alongside mutual exclusion, no preemption, and circular wait. section 11.1.1

Trains waiting for crossings

Imagine several trains, each holding a crossing while waiting for the next crossing to become free. When the trains form a circle, every execution waits for another to release a resource, producing deadlock. section 11.1.1

Figure 11.5 Resource allocation graph for a rail deadlock

Use the resource allocation graph to trace which executions hold resources and which additional resources they await. section 11.1.1

How Learn Concurrent Programming with Go covers it

How deep it goes
Explains the condition through resource allocation graphs and train crossings, then connects it to the four necessary deadlock conditions.
Examples
Uses trains holding crossings and waiting for subsequent crossings to illustrate circular resource waiting.
What you can do after
Evaluate deadlock scenarios by identifying executions that hold resources while requesting additional resources.
How it connects
Connects deadlock with resource allocation graphs, mutual exclusion, no preemption, and circular wait.

This explainer was generated by Manning's knowledge graph from the text of Learn Concurrent Programming with Go. The section links point to the parts of the book it draws on.