RFR: 8355627: Don't use ThreadCritical for EventLog list [v2]
Coleen Phillimore
coleenp at openjdk.org
Wed Apr 30 20:39:30 UTC 2025
On Wed, 30 Apr 2025 20:16:18 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use CAS loop instead of lockFreeStack.
>
> src/hotspot/share/utilities/events.cpp line 58:
>
>> 56: old_head = Atomic::load(&Events::_logs);
>> 57: _next = old_head;
>> 58: } while (Atomic::cmpxchg(&Events::_logs, old_head, this, memory_order_relaxed) != old_head);
>
> I don't think it is safe to use `memory_order_relaxed` order if events are added after JVM enters multi-thread mode.
Thanks for this. I didn't know why Aleksey suggested it. I'll remove it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24954#discussion_r2069401517
More information about the hotspot-dev
mailing list