sandialabs / qthreads

Lightweight locality-aware user-level threading runtime.
https://www.sandia.gov/qthreads/
Other
173 stars 35 forks source link

Race Conditions in qt_loop Implementation #236

Closed insertinterestingnamehere closed 7 months ago

insertinterestingnamehere commented 8 months ago

There are a handful of thread sanitizer errors pointing to various things in our qt_loop interface implementation.

One of the more interesting ones happens when running the qt_loop_balance test: Non-atomic write at: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/qloop.c#L472 Previous non-atomic read at: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/qloop.c#L129.

There are also several more that just involve swapping in some explicit atomic loads and stores to avoid relying on the x86 memory consistency guarantees.