sandialabs / qthreads

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

Explicit Atomics Needed In *incr Functions #224

Closed insertinterestingnamehere closed 9 months ago

insertinterestingnamehere commented 9 months ago

This thread sanitizer failure only shows up when running the qthread_fincr and qthread_dincr tests on ARM. It should hopefully be straightforward to fix though.

For fincr, the issue is the non atomic load and then the atomic store to the same address at https://github.com/sandialabs/qthreads/blob/55ad590801b7188aa5f0e34a8946260a2726046c/include/qthread/qthread.h#L677 and then https://github.com/sandialabs/qthreads/blob/55ad590801b7188aa5f0e34a8946260a2726046c/include/qthread/qthread.h#L679.

The issue for dincr is similar. See https://github.com/sandialabs/qthreads/blob/55ad590801b7188aa5f0e34a8946260a2726046c/include/qthread/qthread.h#L833 and https://github.com/sandialabs/qthreads/blob/55ad590801b7188aa5f0e34a8946260a2726046c/include/qthread/qthread.h#L835.