qthreads icon indicating copy to clipboard operation
qthreads copied to clipboard

Race Conditions in qt_loop Implementation

Open insertinterestingnamehere opened this issue 1 year ago • 0 comments

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.