RFR(XS): make shared variables volatile

Andrew Haley aph at redhat.com
Thu Sep 22 15:29:00 UTC 2016


On 22/09/16 16:07, Roman Kennke wrote:
> The question that came up while discussing this is how to access such
> fields. Atomic and OrderAccess both have no public load() and store()
> methods (or similar). There is load_acquire() and release_store() both
> those are recommended only to be used in pairs. I believe it would have
> the desired effects, but doesn't exactly look clean. Any hints?

acquire and release are exactly what you want.  Whether you do this
with fences or load_acquire() and release_store() does not affect
correctness.  If you see an acquire without a matching release or vice
versa that's probably a bug.

Andrew.



More information about the shenandoah-dev mailing list