RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Apr 18 17:59:10 UTC 2023
On Wed, 12 Apr 2023 07:44:38 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
>>
>> - Merge branch 'master' into JDK-83050920-thread-sleep-subms
>> - Work
>> - Draft work
>> - Merge branch 'master' into JDK-83050920-thread-sleep-subms
>> - Merge branch 'master' into JDK-83050920-thread-sleep-subms
>> - More fixes
>> - Fix Windows yet again
>> - Helper method should be inline, not static
>> - Work
>
> src/hotspot/share/include/jvm.h line 279:
>
>> 277:
>> 278: JNIEXPORT void JNICALL
>> 279: JVM_Sleep(JNIEnv *env, jclass threadClass, jlong millis, jint nanos);
>
> I wonder if it would be simpler to just provide a single value, in nanoseconds, to the VM. That's enough for a sleep of 292 years. Windows would still need to convert to milliseconds of course but it overall would avoid sending two values down to the park code.
Right, that might be better. New revision should address that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13225#discussion_r1170386627
More information about the core-libs-dev
mailing list