RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity

David Holmes dholmes at openjdk.org
Thu Mar 30 01:26:18 UTC 2023


On Wed, 29 Mar 2023 17:17:29 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Are there specific factors which would make it unreasonable to implement `sleep` in terms of `parkNanos`?

You would need to reissue any unparks received whilst sleeping.

Sleeping and parking are distinct thread states so it would be a lot of work in the Java code and in the VM to make such a change.

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

PR Comment: https://git.openjdk.org/jdk/pull/13225#issuecomment-1489551942


More information about the core-libs-dev mailing list