Cycle detection
Cycle detection is a graph-analysis technique for identifying whether traversal returns to a previously visited node, forming a cycle.
Learn Concurrent Programming with Go
Cycle detection is the identification of a closed path in a graph by tracking visited nodes or equivalent traversal state.
- How it is used
- Diagnoses deadlocks by finding circular waits in resource allocation graphs.
- How deep it goes
- Explains a visited-node depth-first-search modification and its runtime consequences, but does not detail graph implementation or complexity.
- Examples
- Uses opposite-order Go mutex locking, Go runtime output, MySQL lock errors, and channel circular waits.
- What you can do after
- Diagnose/debug with graph traversal, recognize circular waits, and choose termination or error-and-retry responses.
Read how Learn Concurrent Programming with Go explains cycle detection →
Building User-Friendly DSLs
Cycle detection is a graph-analysis technique that determines whether a path or dependency chain returns to a previously visited node.
- How it is used
- Prevents invalid DSL attribute dependencies from making code generation loop indefinitely.
- How deep it goes
- Implements recursive chain tracking and diagnostic reporting, while deferring cycle repair to a separate fault-handling strategy.
- Examples
- Uses mutually dependent attributes, a self-referencing attribute, cycle diagrams, and JavaScript diagnostic listings.
- What you can do after
- Diagnoses cyclic attribute references and prevents dependency ordering from producing unsafe generated initialization code.
Read how Building User-Friendly DSLs explains cycle detection →
Related concepts
- resource allocation graphuses · A resource allocation graph is a directed graph whose nodes represent processes or executions and resources, with edges representing resource requests and assignments.
- deadlock detectionused by · Deadlock detection is the process of identifying states in which concurrent processes or tasks are indefinitely blocked by circular dependencies on resources.
- detectionkind of · Detection is the process of identifying whether a specified condition, abnormality, failure, or undesirable behavior is present or suspected.
- depth-first searchimplemented by · Depth-first search is a graph or tree traversal algorithm that explores one branch as far as possible before backtracking to explore alternatives.
- deadlockmeasures · A deadlock is a state in concurrent execution where two or more activities are indefinitely blocked by dependencies on resources, events, or progress that cannot become available.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

