liveBook · Manning

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.

How 2 Manning books explain it

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.

Read how API Design Patterns explains dangling pointer →

Related concepts

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.