Le mardi 30 septembre 2014 07:18:07 UTC+2, Sam Roberts a écrit : > > I wonder if there is a conflict in use case between general purpose > timers, of which there can be many, and high precision timers, of > which maybe you only want a few. > > The OP can use create timer fds himself, and add them to the uv loop > to be watched, to get the precision he wants within uv, I think. > > Perhaps if a perfect API can't be found in uv, a new higher precision > timerfd based API with caveats about how many of these you can/should > create would be useful?
Hi Sam, Your idea is interesting. After reading the reactions on my initial post, I wonder if it's a constructive proposal to split the question into multiples aspects: 1) Should libuv offer API for periodic timer ? The actual implementation do not and in fact correspond to a one shot timer restarted at the end of the callback. If the response is no, then actual API and documentation should be changed. If the response is yes, the implementation should be changed. I hope that the libuv community found an advantage to respond yes to this question, as periodic timers is certainly a common feature request and libuv is in best place to implement it. 2) Should libuv use timerfd to implement the aspect 1 in case the response is yes ? Certainly no in general as timerfd is usable only on Linux starting from kernel 2.6.23 or so. Depending on the performances of the general code for periodic timer (if there is any) timerfd might allow an improvement, but this is too early to be certain about that at this stage. 3) Should libuv offer a high precision timer API ? From a API point of view, it would be better to have a single API that scale and stay precise. An example on how to use timerfd watcher will be an immediate advantage for not too old Linux kernel users. Best Regards. Jean-Christian -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to libuv+unsubscr...@googlegroups.com. To post to this group, send email to libuv@googlegroups.com. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.