sandialabs / qthreads

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

Adjust Fences in Syncvar Implementation #255

Closed insertinterestingnamehere closed 1 week ago

insertinterestingnamehere commented 5 months ago

It seems like the syncvar implementation needs an equivalent of https://github.com/sandialabs/qthreads/pull/250. I've spent some time reviewing the syncvar implementation and it's distinct enough that there's not an exact analog of those changes, however we need to check that a fence happens reliably even when the value of the FEB isn't requested via the API (either by passing the same FEB as input and output or passing a null destination). The syncvar code seems much less susceptible to issues here than the aligned_t implementation was, but I'd still like to check it more carefully to make sure everything is okay.

insertinterestingnamehere commented 1 week ago

Syncvars are correct as written due to the acq_rel ordering of qthread_cas64 when used in qthread_mwaitc which is used for the critical loads and stores for the implementation of syncvars.