RFR: 8245594: Remove volatile-qualified member functions and parameters from oop class

David Holmes david.holmes at oracle.com
Mon May 25 02:32:00 UTC 2020


On 25/05/2020 10:53 am, Kim Barrett wrote:
>> On May 24, 2020, at 8:01 PM, David Holmes <david.holmes at oracle.com> wrote:
>>
>> Okay this is really nothing to do with Atomic::store at all. using the initializer list is the obviously correct and simple way to do this.
> 
> There are many reasons to prefer using initializer lists for
> initialization. In this case, one is not needing to have a weak atomic
> store, as those generally engender additional scrutiny.  I guess my
> RFR description was overly terse and suggested more than was intended.
> 
>>>> Hmmm. Granted "volatile" on a Class type has no meaning. But I always think of oop as really being a pointer type so volatile actually makes some sense there.
>>>> […]
>>
>> Okay, but I still don't see why we would not remove the volatile qualifier for these oop cases.
> 
> It "tags" the variable as being read/written by multiple threads and
> semantically atomic. And unlike similar usage with fundamental types,
> because we've eliminated the volatile qualifiers in member functions,
> the compiler will help us remember to use atomic accesses.

I have no issue with using "volatile" as a tag but I'm confused that we 
now will have two distinct conventions in this area.

Cheers,
David



More information about the hotspot-dev mailing list