Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-19 Thread Nir Soffer
On Apr 19, 2012, at 7:30 AM, Nick Mathewson wrote: On Tue, Apr 10, 2012 at 7:21 PM, Nir Soffer wrote: On Apr 10, 2012, at 6:15 PM, Nick Mathewson wrote: And there's a third way for libevent to see a big jump forward in time: if the program calls event_base_loop() sporadically, it is free

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-18 Thread Nick Mathewson
On Tue, Apr 10, 2012 at 7:21 PM, Nir Soffer wrote: > > On Apr 10, 2012, at 6:15 PM, Nick Mathewson wrote: > >> And there's a third way for libevent to see a big jump forward in >> time: if the program calls event_base_loop() sporadically, it is free >> to wait as long as it wants between invocatio

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-11 Thread 卓宜黄
I found this issue only happening on Windows server 2003 32bits, and I'm sure that the timer runs properly on centos 6.0 64bits vm system whereas, I can tell no more to you all, I just wonder why not use GetTickCount instead of gettimeofday while compiling Windows version. Although it could decreas

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-10 Thread William Ahern
On Wed, Apr 11, 2012 at 02:21:13AM +0300, Nir Soffer wrote: > Forward jumps should simply skip events in the past. It is just like > events skipped because the event loop was blocked. > > If you should run every 5 seconds, but woke up 21 seconds late, you > cannot fix the past - you just miss

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-10 Thread Nir Soffer
On Apr 10, 2012, at 6:15 PM, Nick Mathewson wrote: And there's a third way for libevent to see a big jump forward in time: if the program calls event_base_loop() sporadically, it is free to wait as long as it wants between invocations. So, what's the right behavior for periodic events in these

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-10 Thread Nick Mathewson
On Mon, Apr 9, 2012 at 11:44 PM, 卓宜黄 wrote: > Hi all, > > I found an issue that it will trigger the timer callback dramatically > like a dead looping when moving the system time backward for a year > and then moving it forward to the accurate time. > Of course, I had to change the system time for

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-10 Thread Nick Mathewson
On Tue, Apr 10, 2012 at 1:03 AM, William Ahern wrote: > On Tue, Apr 10, 2012 at 11:44:39AM +0800, 卓宜黄 wrote: >> Hi all, >> >> I found an issue that it will trigger the timer callback dramatically >> like a dead looping when moving the system time backward for a year >> and then moving it forward t

Re: [Libevent-users] a dead looping bug when changing system time backward

2012-04-09 Thread William Ahern
On Tue, Apr 10, 2012 at 11:44:39AM +0800, 卓宜黄 wrote: > Hi all, > > I found an issue that it will trigger the timer callback dramatically > like a dead looping when moving the system time backward for a year > and then moving it forward to the accurate time. AFAICT, the libevent 2.x code uses cloc

[Libevent-users] a dead looping bug when changing system time backward

2012-04-09 Thread 卓宜黄
Hi all, I found an issue that it will trigger the timer callback dramatically like a dead looping when moving the system time backward for a year and then moving it forward to the accurate time. Of course, I had to change the system time for other activities then. However, I've made a test case fo