RFR: 8186838: Generalize Atomic::inc/dec with templates

Andrew Haley aph at redhat.com
Fri Sep 8 07:13:47 UTC 2017


On 06/09/17 15:13, Erik Österlund wrote:
> Hi Andrew,
> 
> On 2017-09-06 15:20, Andrew Haley wrote:
>> On 05/09/17 09:04, Erik Österlund wrote:
>>
>>> For example, our atomics typically conservatively guarantees
>>> bidirectional full fencing, while theirs does not.
>> Firstly, we can insert whatever fences we want, using intrinsics.  We
>> don't need assembly language to do that.
> 
> Since I thought we already had (and finished) that discussion, and it is 
> no longer relevant to the current proposal of removing inc/dec 
> specializations, I hope you are okay with me preferring not to re-open 
> that discussion in this RFE. Another day, perhaps?

Well, let us make a deal: if you don't say something I disagree with, I promise
not to disagree.  :-)


> 
>> Secondly, I don't see bidirectional full fencing in x86 atomics, and I
>> don't think we really want bidirectional full fencing anyway.
> 
> That is because an atomic x86 locked instruction is observably 
> equivalent to having bidirectional fencing surrounding the access due to 
> the stronger memory model of the machine.

TSO, as implemented by x86, is very strong, but is it really equivalent to
bidirectional fencing?

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list