Dangling pointer
A dangling pointer is a pointer or reference to an object or memory whose lifetime has ended or is otherwise no longer valid to access.
C++ Concurrency in Action, Second Edition
A dangling pointer is a pointer that refers to an object whose lifetime has ended or whose storage is no longer valid.
- How it is used
- Explains a memory-lifetime hazard in concurrent lock-free stack operations.
- How deep it goes
- Traces the pop race and shows delayed deletion and split reference counts as ways to prevent unsafe access.
- Examples
- Demonstrates two pop threads competing over one node and a reference-counted implementation.
- What you can do after
- Understand why a thread must secure a node’s lifetime before dereferencing its pointer.
Read how C++ Concurrency in Action, Second Edition explains dangling pointer →
API Design Patterns
A dangling pointer is a pointer that refers to a data object or resource that no longer exists.
- How it is used
- Handles deletion decisions when API resources refer to one another.
- How deep it goes
- Defines invalid references, compares four deletion policies, and examines circular references, bulk writes, and deletion avalanches.
- Examples
- Uses book-author resources, the Becoming example, circular author-book references, and association resources.
- What you can do after
- Evaluate deletion policies and recognize when an API should return HTTP 412 or tolerate invalid references.
Related concepts
- Rustaddressed by · Rust is a statically typed systems programming language designed for performance, concurrency, and memory safety without requiring garbage collection.
- association resourceproduced by · An association resource is an API resource that represents a relationship between specific resources and whose associated endpoints are fixed for the resource's lifetime.
- referencekind of · A reference is an indirect value or relationship that identifies or provides access to another value, object, resource, or source.
- undefined behaviorproduces · Undefined behavior is program execution for which the applicable language specification imposes no requirements on the resulting behavior or effects.
- missing valuecontrasts with · A missing value is a representation or condition indicating that an expected data value or object reference is absent, unknown, unavailable, or inapplicable.
- pointerkind of · A pointer is a value that refers to a memory location or another object, enabling indirect access to it.
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.

