Skip to content

fix(bug): Implemented TSAN fixes for concurrency_breadth_first_search(#550) - #602

Merged
ZigRazor merged 1 commit into
ZigRazor:masterfrom
vansh-09:fix/TSAN-fix
Jun 15, 2026
Merged

fix(bug): Implemented TSAN fixes for concurrency_breadth_first_search(#550)#602
ZigRazor merged 1 commit into
ZigRazor:masterfrom
vansh-09:fix/TSAN-fix

Conversation

@vansh-09

Copy link
Copy Markdown
Contributor

Implemented TSAN fixes for concurrency_breadth_first_search in include/CXXGraph/Graph/Algorithm/BestFirstSearch_impl.hpp:

  • Prevented the hang by replacing the wait/notify scheme with a mutex-consistent phase/generation predicate (phase) used by all workers’ condition_variable waits.
  • Removed TSAN data races on visited by making visited atomic (std::vector<std::atomic<uint8_t>>) and atomically claiming nodes via compare_exchange_strong.
  • Added a safe phase-advance/notify when the frontier becomes empty so workers can exit without deadlocking.

@ZigRazor ZigRazor linked an issue Jun 15, 2026 that may be closed by this pull request
@ZigRazor
ZigRazor merged commit e471252 into ZigRazor:master Jun 15, 2026
58 of 88 checks passed
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.

Lost wake-up in concurrency_breadth_first_search

2 participants