in reply to Re^2: AnyEvent timers by EV
in thread AnyEvent timers by EV
Not so fast . . . kindly please do not automatically presume that I know not whereof I speak, and thus to dismiss what <<I>&;gt; say on just that reason. :-)
In the instant case, a local timer, running for so-many milliseconds locally, is being set against a timeout of a remote TCP/IP exchange. Necessarily, a timeout against a remote machine will require some additional milliseconds to resolve ... milliseconds spent informing the client that a timeout has, in fact, occurred. The AnyEvent authors were obviously very sensitive to such issues, and they actually spent quite a bit of time in their documentation discussing it. It appears to me that the OP’s test-case does not take these issues into proper account, thereby leading to the (erroneous?) observation of “even/odd.”
Basically, “it will take you somewhat-more than 200 milliseconds to conclude that a 200-millisecond timeout has timed-out.” (And, as Anonymous Monk originally observed, it is actually quite unpredictable just how many “more than” milliseconds, might be required.) A strictly-local timer knows nothing of real-world network delays, whereas a valid conclusion cannot ignore them. C’est la guerre ...
EDIT: Kindly now draw your attention to what krambambuli subsequently posted. I think he hit an important nail on the head here ... and something I did not know ... to decisively explain the “even/odd” behavior.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: AnyEvent timers by EV
by bash (Scribe) on Apr 02, 2015 at 14:44 UTC | |
|
Re^4: AnyEvent timers by EV
by Anonymous Monk on Apr 02, 2015 at 01:44 UTC |