RFR: 8344797: GenShen: Update and rename confusing method [v2]

William Kemper wkemper at openjdk.org
Fri Nov 22 17:33:21 UTC 2024


On Fri, 22 Nov 2024 00:41:58 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 881:
>> 
>>> 879:   // update costs on slow path.
>>> 880:   monitoring_support()->notify_heap_changed();
>>> 881:   _heap_changed.try_set();
>> 
>> I'm not sure I understand the significance of this change from .set() to .try_set().
>
> Would a comment help explain why it is ok for set() to fail here?

It was an unnecessary change. Upstream has `try_set`. We just need one thread to set it. `try_set` avoid modifying the shared variable if it is already set.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/550#discussion_r1854349553


More information about the shenandoah-dev mailing list