Hazard Pointers and Deferred Reclamation
Publish which object a reader intends to use and validate that the object is still reachable before accessing it.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Protection must close the gap after loading a candidate
A reader can load a shared reference, publish it in its hazard slot, then recheck the shared location under the algorithm’s ordering rules. If the reference changed, it retries before accessing the candidate object. The recheck prevents a stale initial observation from becoming unchecked use. A removal retires an object and need not wait for every reader to finish before unlinking it.
Free only after the relevant hazards have been checked
Reclamation scans the published protection slots using the prescribed protocol. A retired object named by a slot remains deferred. A thread typically protects a small number of objects at once, which changes per-node bookkeeping compared with a whole-region scheme. Correctness depends on ordering, how publication races with retirement and what values are revalidated. Epoch reclamation uses a different lifetime boundary. ABA explains when representation identity merits separate reasoning.[1][2]