RFR: 8328679: Improve comment for UNSAFE_ENTRY_SCOPED in unsafe.cpp [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Mar 21 19:26:33 UTC 2024


On Thu, 21 Mar 2024 18:57:23 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address review comments
>
> src/hotspot/share/prims/unsafe.cpp line 94:
> 
>> 92: // If an async exception handshake were installed in such a safepoint,
>> 93: // memory access might still occur before the handshake is honored by
>> 94: // the accessing thread.
> 
> It's not so much that we can't have safepoints, it's more that we avoid them, since they allow async exception to be installed, which in turn allows memory to be freed.
> 
> Maybe you could put something like: `As a rule, we disallow further safepoints within a scoped method` at the end of the previous (2nd) paragraph, and then drop the 3rd paragraph.

I've adopted your `As a rule` suggestion, but kept the para, as IMHO the structure is important:
1. first para talks about on-entry
2. second para talks about safe point restrictions in general
3. third para adds detail on the fact that no safe point means "no native state"

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18429#discussion_r1534537318


More information about the hotspot-dev mailing list