Skip to content

docs(advanced): document lock-free data structures (RCU, epoch-based reclamation)#369

Merged
kcenon merged 3 commits into
mainfrom
docs/issue-365-document-lock-free-data-structures
Feb 9, 2026
Merged

docs(advanced): document lock-free data structures (RCU, epoch-based reclamation)#369
kcenon merged 3 commits into
mainfrom
docs/issue-365-document-lock-free-data-structures

Conversation

@kcenon

@kcenon kcenon commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Closes #365

Summary

  • Add docs/advanced/LOCK_FREE.md covering internal lock-free primitives
  • Document rcu_value<T> RCU pattern: wait-free reads, lock-free updates, shared_ptr-based reclamation
  • Document epoch_manager epoch-based reclamation: 3-epoch rotation, deferred deletion, RAII guard
  • Cover integration with lockfree_container_reader and auto_refresh_reader
  • Include correctness guarantees (memory ordering, ABA avoidance, progress guarantees)
  • Include performance characteristics, scalability analysis, and comparison with alternatives

Test Plan

  • Verify documentation renders correctly on GitHub
  • Cross-reference API descriptions against source code in internal/rcu_value.h and internal/epoch_manager.h
  • Confirm all code examples are accurate and compile-ready

…reclamation)

Add comprehensive documentation for internal lock-free primitives:
- rcu_value<T>: RCU pattern with wait-free reads and lock-free updates
- epoch_manager: epoch-based memory reclamation with 3-epoch rotation
- Integration with lockfree_container_reader and auto_refresh_reader
- Correctness guarantees, memory ordering, and ABA problem avoidance
- Performance characteristics and comparison with alternatives
- Add copy/move constructors and assignment operators to rcu_value API table
- Document legacy type alias lockfree_reader = snapshot_reader with warning
- Fix code examples: use int32_t instead of int to match ValueVariantType concept
@kcenon

kcenon commented Feb 8, 2026

Copy link
Copy Markdown
Owner Author

Test Plan Verification

1. Verify documentation renders correctly on GitHub

  • Status: PASS
  • All 25 CI checks passed (CI, Coverage, Security, Sanitizers, Static Analysis, Integration Tests)
  • File renders at: docs/advanced/LOCK_FREE.md (511 → 522 lines after fixes)

2. Cross-reference API descriptions against source code

  • Status: PASS (after fixes in 85c91eb)
  • Memory orderings: 100% accurate (all 7 entries verified against source)
  • Progress guarantees: 100% accurate
  • Constants (NUM_EPOCHS=3, INACTIVE=UINT64_MAX): verified
  • Thread safety classifications: all correct
  • Fixed: Added missing copy/move constructors to rcu_value API table
  • Fixed: Documented legacy lockfree_reader = snapshot_reader alias with warning

3. Confirm all code examples are accurate and compile-ready

  • Status: PASS (after fixes in 85c91eb)
  • rcu_value usage examples: match source signatures
  • epoch_manager usage examples: match both defer_delete overloads
  • epoch_guard RAII example: matches source
  • Internal implementation snippets: match source (simplified for clarity)
  • Fixed: Changed get<int> to get<int32_t> to match ValueVariantType concept constraint

@kcenon kcenon merged commit 33b49b1 into main Feb 9, 2026
25 checks passed
@kcenon kcenon deleted the docs/issue-365-document-lock-free-data-structures branch February 9, 2026 00:33
kcenon added a commit that referenced this pull request Apr 13, 2026
…reclamation) (#369)

* docs(advanced): document lock-free data structures (RCU, epoch-based reclamation)

Add comprehensive documentation for internal lock-free primitives:
- rcu_value<T>: RCU pattern with wait-free reads and lock-free updates
- epoch_manager: epoch-based memory reclamation with 3-epoch rotation
- Integration with lockfree_container_reader and auto_refresh_reader
- Correctness guarantees, memory ordering, and ABA problem avoidance
- Performance characteristics and comparison with alternatives

* docs(advanced): fix review findings in lock-free documentation

- Add copy/move constructors and assignment operators to rcu_value API table
- Document legacy type alias lockfree_reader = snapshot_reader with warning
- Fix code examples: use int32_t instead of int to match ValueVariantType concept

* docs(advanced): fix typo in epoch diagram (Retire -> List)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] docs: Document lock-free data structures (RCU, epoch-based reclamation)

1 participant