java - How to accelerate the cpu's uptime? -
there jdk bug: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8022628
it java.net.sockettimeoutexception in 49.7 days.
in link, says "we've accelerated cpu's uptime". want make test bug, don't know how "accelerate cpu's uptime".
import java.io.ioexception; import java.net.serversocket; public class testsocket { public static void main(string[] args) throws ioexception { serversocket serversocket = new serversocket(5555); serversocket.accept(); } }
i ran program above, changed time 49.7 days later, or more later, there's no sockettimeoutexception.
jdk version: java version "1.7.0_79" java(tm) se runtime environment (build 1.7.0_79-b15) java hotspot(tm) server vm (build 24.79-b02, mixed mode)
most means set clock forward. timers based on clock, moving clock forward makes timers expire sooner.
this why, incidentally, ntp avoids abrupt clock adjustments: can cause aberrations in programs timers. prefers perform slow, gradual adjustments on period of time.
Comments
Post a Comment