Skip to content

fix thread safety and data races of openmp backend#5876

Open
kumaraditya303 wants to merge 2 commits into
OpenMathLib:developfrom
kumaraditya303:openmp
Open

fix thread safety and data races of openmp backend#5876
kumaraditya303 wants to merge 2 commits into
OpenMathLib:developfrom
kumaraditya303:openmp

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR is a followup to #5844 and #5838 and fixes thread safety issues and data races in openmp implementation backend.

The main important change is that now if C11 is supported the it now uses atomics based locking instead of platform specific assembly code to do the locking which isn't compatible with TSAN nor fully safe, volatile reads/writes are not sufficient to prevent data races. I've also setup CI to test the openmp backend under TSAN and there are several other fixes to use atomics where necessary to fix the remaining data races. After all these fixes there are no data races while running the thread safety tests under TSAN.

@kumaraditya303 kumaraditya303 marked this pull request as ready for review July 2, 2026 13:23
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.

1 participant