RFR: 8354452: Shenandoah: Enforce range checks on parameters controlling heuristic sleep times

William Kemper wkemper at openjdk.org
Fri Apr 11 21:12:26 UTC 2025


On Fri, 11 Apr 2025 21:09:36 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Hmm, curious, I see this:
>> 
>> // Convenience wrapper around naked_short_sleep to allow for longer sleep
>> // times. Only for use by non-JavaThreads.
>> void os::naked_sleep(jlong millis) {
>>   assert(!Thread::current()->is_Java_thread(), "not for use by JavaThreads");
>>   const jlong limit = 999;
>>   while (millis > limit) {
>>     naked_short_sleep(limit);
>>     millis -= limit;
>>   }
>>   naked_short_sleep(millis);
>> }
>
> Still if ppl aren't gonna need longer than 1 sec, and longer is a bad idea, then limiting it is a good idea.
> Reviewed. 🚢

Aye - we _could_ use that, but I don't think we _should_. Having the heuristics sleep longer than this between evaluations wouldn't do anyone any good.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24602#discussion_r2040299379


More information about the shenandoah-dev mailing list