HashedWheelTimer and changing system time

Christian Migowski chrismfwrd at gmail.com
Fri Jun 25 02:02:30 EDT 2010


Hi John,

thanks, it was interesting to read about monotonic timers.
What I've understood is that in java System.nanoTime is supposed to
use such a monotonic timer (i.e. shouldn't be affected by time
changes), but the timer used is broken in some Windows versions.

I guess it is up to Trustin what do implement: Support best
correctness on most platforms (i.e. stay with currentTimeMillis) or
support a (IMO) not so common/frequently happening use case (i.e. use
nanoTime and not be affected by changing system time)


greetings,
christian!



On Thu, Jun 24, 2010 at 7:22 PM, John D. Mitchell <jdmitchell at gmail.com> wrote:
> I haven't look at Windows' timers in a very long time but...
>
> Does Windows support a monotonic timer? They are precisely for solving
> these types of problems.
>
> Have fun,
> John
>
> On Jun 24, 2010, at 01:19 , Christian Migowski wrote:
>
>> It is not broken, just like I said, your test is rather strange
>> (changing time back and forth).
>> I just ran your test, here the timeout fires in the next round (i.e.
>> after an additional 30 seconds), which is IMHO fair enough under this
>> circumstances.
>> If you change time in just one direction (as it would happen with DST
>> or time servers), it works as expected.
>>
>> regards,
>> christian!
>>
>>
>> On Thu, Jun 24, 2010 at 9:32 AM, Evgeniy Devyatyh
>> <devyatyh at gmail.com> wrote:
>>>
>>>>> it is a strange test
>>> Myabe, it's just synthetic test.
>>>
>>> But anyway why when timeout expired (HashedWheelTimeout(deadline:
>>> 656 ms
>>> ago, ) ) timer task not run?
>>>
>>> Ok, nanoTime is broken, but currentTimeMillis broken too because if
>>> Windows
>>> synchronize system clock or change time for daylight savings all
>>> timer tasks
>>> may not run?
>>> --
>>> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/HashedWheelTimer-and-changing-system-time-tp5216326p5216556.html
>>> Sent from the Netty User Group mailing list archive at Nabble.com.
>>> _______________________________________________
>>> netty-users mailing list
>>> netty-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/netty-users
>>>
>> _______________________________________________
>> netty-users mailing list
>> netty-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/netty-users
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>


More information about the netty-users mailing list