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

2023-04-19 Thread Aleksey Shipilev
> Java API has the `Thread.sleep(millis, nanos)` method exposed to users. The > documentation for that method clearly says the precision and accuracy are > dependent on the underlying system behavior. However, it always rounds up > `nanos` to 1ms when doing the actual sleep. This means users can

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

2023-04-19 Thread David Holmes
On Wed, 19 Apr 2023 19:55:38 GMT, Aleksey Shipilev wrote: >> Java API has the `Thread.sleep(millis, nanos)` method exposed to users. The >> documentation for that method clearly says the precision and accuracy are >> dependent on the underlying system behavior. However, it always rounds up >>

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

2023-04-20 Thread Aleksey Shipilev
On Thu, 20 Apr 2023 02:14:53 GMT, David Holmes wrote: >> Aleksey Shipilev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Adjust test times > > src/hotspot/os/windows/os_windows.cpp line 5263: > >> 5261: if (nanos_left > 0) { >> 5262:

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

2023-04-21 Thread Alan Bateman
On Thu, 20 Apr 2023 08:12:50 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/lang/Thread.java line 1: >> >>> 1: /* >> >> Why doesn't `Thread.sleep(long millis)` simply call `Thread.sleep(millis, >> 0)` instead of duplicating most of the code? > > That would change the stack de