[concurrency-interest] Why not "weakNanoTime" for jdk9?

Martin Buchholz martinrb at google.com
Mon Mar 9 20:30:26 UTC 2015


Perhaps I shouldn't have tried to do anything on this front, given the
cross-system difficulties that especially David has battled for years.  I'm
surprised Aleksey is not a fan - I expected Aleksey to want a version of
nanoTime more suitable for benchmarking.

I learned about the various "clocks" on linux/posix.  I'm surprised the
low-level CLOCKs also promise monotonicity (CLOCK_MONOTONIC).  Perhaps what
was really originally intended was that CLOCK_MONOTONIC was immune to the
effects of sysadmin action (and also adjustments by NTP would be gradual
and preserve monotonicity).

Anyways, having a version of nanoTime that does not promise monotonicity is
only useful if there is a significant benefit, probably in reduced overhead.

No consensus - giving up.



More information about the core-libs-dev mailing list