[concurrency-interest] DirectByteBuffers and reachabilityFence

Andrew Haley aph at redhat.com
Tue Dec 8 13:53:58 EST 2015


On 12/08/2015 06:48 PM, Vitaly Davidovich wrote:
>>
>> Yes, that is my claim.  It's certainly true in the case of concurrent
>> code, which is the subject of this list.  It's certainly true in the
>> case of reachability, which is the subject we're discussing.
> 
> I missed this part.  For concurrent code, how about the fact that volatile
> writes in a constructor are effectively treated like final field writes,
> even though current JMM does not mandate that? Last I heard, a future JMM
> revision will make it such that existing behavior is actually spec'd simply
> because lots of existing code relies on it and would break, subtly, if that
> were to change.

I'm trying to figure out exactly what point you're making.  In what
sense are volatile writes in a constructor effectively treated like
final field writes?  From the code I've looked at, volatile writes in
a constructor are treated exactly like any other kind of volatile
writes: they're sequentially consistent, and there's nothing stronger
than that.

Andrew.


More information about the Concurrency-interest mailing list