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
- 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.
- 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.
- deadlockmeasures · A deadlock is a state in concurrent computing where two or more activities cannot progress because each waits for a resource or action held up by another.
- depth-first searchimplemented by · Depth-first search is a traversal strategy that follows a branch as far as possible before backtracking to explore alternatives.
Questions about cycle detection
What is cycle detection?
Cycle detection is a graph-analysis technique for identifying whether traversal returns to a previously visited node, forming a cycle.
Which Manning books explain cycle detection?
Learn Concurrent Programming with Go and Building User-Friendly DSLs.
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.

