timerfd

Marc Lehmann schmorp at schmorp.de
Thu Mar 24 05:28:32 CET 2011


On Wed, Mar 23, 2011 at 07:44:05PM -0700, Alex Leone <acleone at gmail.com> wrote:
> Marc - do you have any thoughts on linux timerfd's [1]?

I had lots of thoughts about timerfd, but I couldn't come up with a any
use for them.

The nice thing about them is that they support relative and absolute
timers for both realtime and monotonic clocks, so maybe one could get
better/faster/more certain time jump detection etc., but so far, I can't
see how this could be done without a lot of extra effort, either.

> think go into a red-black tree.  My gut feeling is that doing the timing in
> userspace is probably a tad faster.

That's my guess, too - you'd have several extra syscalls per iteration,
while on many architectures you don't even need a single syscall when
doing it in userspace (assuming clock_gettime runs in userspace).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list