RFR (S): 8165859: gcTaskThread is missing volatile qualifier and barriers for _time_stamps

Carsten Varming varming at gmail.com
Mon Sep 19 19:36:56 UTC 2016

Dear Kim,

Reading a volatile field updated by cmpxchg does not need an acquire

BTW. The specification in atomic.hpp says cmpxchg provides: "<fence>
compare-and-exchange <membar StoreLoad|StoreStore>". The release is part of
the fence. Are you suggesting that there is a release after the exchange?


On Mon, Sep 19, 2016 at 3:18 PM, Kim Barrett <kim.barrett at oracle.com> wrote:

> > On Sep 19, 2016, at 2:26 PM, Carsten Varming <varming at gmail.com> wrote:
> >
> > Dear Erik,
> >
> > According to orderAccess.hpp an acquire is supposed to be paired with a
> release. It doesn't look like there is any synchronization on the data
> written to the time stamp array, so what exactly is going on?
> >
> > Carsten
> _time_stamps gets written with a cmpxchg_ptr (line 63 of
> gcTaskThread.cpp), which includes release semantics for the write; see
> atomic.hpp.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20160919/735a8e86/attachment.htm>

More information about the hotspot-gc-dev mailing list