On Wed, 29 Nov 2023 08:24:22 GMT, Stefan Johansson <sjoha...@openjdk.org> wrote:

>> Jonathan Joo has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - Fix namespace issues (2)
>>    
>>    Co-authored-by: Stefan Johansson 
>> <54407259+kstef...@users.noreply.github.com>
>>  - Fix namespace issues
>>    
>>    Co-authored-by: Stefan Johansson 
>> <54407259+kstef...@users.noreply.github.com>
>
> src/hotspot/share/runtime/cpuTimeCounters.cpp line 91:
> 
>> 89:   } while (old_value != fetched_value);
>> 90:   get_counter(CPUTimeGroups::CPUTimeType::gc_total)->inc(fetched_value);
>> 91: }
> 
> Why do we have to do this publish dance? Couldn't the closure that update the 
> diff instead just update the counter? From what I can tell we never have 
> multiple closures active at the same time so should be no race there?

This two-step update does seem unnecessary, IMO.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1409452326

Reply via email to