On Thu, 18 Jun 2026 15:45:26 GMT, ExE Boss <[email protected]> wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Improve performance for VTs
>
> src/java.base/share/classes/jdk/internal/foreign/ConfinedSegmentPool.java 
> line 61:
> 
>> 59:     static final long POOLED_MEMORY_SIZE = 
>> clampedPowerOfPropertyOr(POOLED_MEMORY_PROPERTY, 6);
>> 60: 
>> 61:     private static volatile boolean virtualPoolInitialized;
> 
> This should probably be kept `@Stable`, so that it can be constant folded 
> once `VirtualThreadPool` is initialised:
> Suggestion:
> 
>     @Stable
>     private static volatile boolean virtualPoolInitialized;

I had `@Stable` a while but decided against it as it is not on the critical hot 
path and the complexity would be higher (especially reviewing the setting from 
<clinit>). I've added a comment describing how the field is used. I hope that 
would be enough.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31365#discussion_r3452828231

Reply via email to