Request for reviews (S): 6863420: os::javaTimeNanos() go backward on Solaris x86
Vladimir Kozlov
Vladimir.Kozlov at Sun.COM
Thu Jul 23 17:56:46 PDT 2009
http://cr.openjdk.java.net/~kvn/6863420/webrev.00
Fixed 6863420: os::javaTimeNanos() go backward on Solaris x86
Problem:
The problem is non atomic load from max_hrtime in getTimeNanos()
on platforms where long is kept in 2 32-bit register.
The loaded value could be invalid (> current time) since registers
are loaded separately and store could happened in between.
It could be returned as result if it is greater then current time.
And if the next call getTimeNanos() returns the correct time
it will be less then previous result.
Solution:
Use new atomic long load method Atomic::load() which uses
FPU to move long value atomically.
Added the regression test which shows the problem.
Reviewed by:
Fix verified (y/n): y, regression test
Other testing:
JPRT
More information about the hotspot-dev
mailing list