RFR: 8267952: async logging supports to dynamically change tags and decorators [v2]
David Holmes
dholmes at openjdk.java.net
Thu Jun 10 12:52:16 UTC 2021
On Thu, 10 Jun 2021 07:16:23 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> I understand there is a race. I'm asking you to add a comment explaining there is a race so that someone is not tempted to reorder these statements again. That said it seems to me that we also require a `loadload` barrier between these (which would pair with the storestore barrier in `LogConfiguration::configure_output`).
>
> I see. I would like to convince reviewers first. I will add some comments here.
>
> I don't think loadload barrier is necessary. volatile in c/c++ is a little bit different from Java. we can't fully apply JSR-133 here. Yes, we do need to make sure Atomic::add() happens before load of decorators. This is done by the implied memory barrier of `Atomic::add`.
I have no idea why you mention volatile and jsr-133 here.
If there is an Atomic::add inside there then okay the necessary barrier may be in place. But it is not at all apparent there is an Atomic operation inside there, so given the order is important the comment needs to explain why an explicit barrier is not needed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4408
More information about the hotspot-runtime-dev
mailing list