RFR(XS): make shared variables volatile

Andrew Haley aph at redhat.com
Thu Sep 22 15:47:44 UTC 2016


On 22/09/16 16:29, Zhengyu Gu 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?

> Based on recent discussion on runtime-dev mailing list,
> load_acquire()/release_store() is the direction openjdk is heading
> to.

Indeed, but there are cases where you want a fence after a store, and
release_store() is the wrong way round for that.  So it depends on
the circumstances.

Andrew.


More information about the shenandoah-dev mailing list