lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] core/timers.c with NO_SYS?


From: address@hidden
Subject: Re: [lwip-devel] core/timers.c with NO_SYS?
Date: Sun, 12 Jun 2011 18:05:09 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

Leon Woestenberg wrote:
Hello Simon, Kieran,

On Sun, Jun 12, 2011 at 2:13 PM, address@hidden<address@hidden>  wrote:
Aside from that, how do you propose to implement a generic timer framework
without knowing the time? You do need a port-dependent function to get the
time for that.
Depends on whether you want to support absolute time or not. In
previous versions, only relative time was needed (for timeouts).
That's with NO_SYS==0. And it has the downside of introducing jitter which depends on the number of packets coming in, up to the point where timeouts are not processed at all if packets come in faster than the stack pulls them from the queue (since the mbox code reports that it didn't wait at all).

There's not been such code for NO_SYS==1, however, so there are no previous version of timeouts for that. Now you can of course leave it up to the port to call sys_check_timeouts() with an argument how much time has passed since the last call, but that doesn't make the port easier to code. On the other hand, a simple function returning the current time should not be too hard to implement.

Anyway, you can implement it in both ways, one works is as good as the other. It happens to be implemented with absolute times right now since (to me), it's more straightforward when creating a port.

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]