Re: [RFCv2 1/2] misc: Add timer API


Luiz Augusto von Dentz
 

Hi Ben,

On Mon, Apr 25, 2016 at 6:50 PM, Benjamin Walsh
<benjamin.walsh(a)windriver.com> wrote:
On Mon, Apr 25, 2016 at 02:08:00PM +0200, Tomasz Bursztyka wrote:
Hi Benjamin,

2. I am not sure about the naming. This is yet another timer library,
when we already have nano timers and micro timers. What makes it special
is its callback functionality. Can we try to get that into the name ?
Sure we can add a timeout or callback to the name, but IMO this would
be much more useful than nano_timer thus why I would like to promote
it over it.
Since nobody is suggesting anything here are some alternatives:

sys_timer_callback*: quite long imo
sys_callback: doesn't say much
sys_timeout: I would favor this one
Me too.

I would prefer sys_callback I think: you add a callback with a timeout
shows that there is a timeout/timer IMHO.
A timeout says all without people to read parameters. At a timeout
usually, it means you want to do something, thus the callback. It's
not suprizing timeout keyword is usually preferred in some user-land
libraries on Linux or else.
Don't you think it would be confusing for a user that we have two timer
APIs and a timeout API ?
Well that was what I mentioned that the use of nano_timer is very
limited, if you look at the unit test you will quickly realize how
hard it is to use in practice. That said Im in favor of push this
quickly and then decide the name later since we do depend in this
functionality to implement some protocol requirements in Bluetooth and
probably IP will switch to use it as well.

--
Luiz Augusto von Dentz

Join devel@lists.zephyrproject.org to automatically receive all group messages.