[Click] Click Timers

Ashish Sharma ashishs.sharma at gmail.com
Wed Jul 30 05:32:43 EDT 2008


Hi,

I am curious to know how timers are implemented in Click. I was wondering
if Click timers are implemented using regular kernel timers and if that was
the
case if there was any implementation using hrtimers. However looking through
the
Click source code I found none. Instead I found that in lib/master.cc Click
maintains its own heap for timers and runs Master::run_timers in
routerthread.cc

Correct me if I am wrong, but this is what my guess is regarding whats going
on.
Every time click thread gets scheduled in the kernel, all the timers in the
heap
are checked and the timers are woken up after they expire. Now this is
dependent
on how frequently Click gets scheduled, which should work better if it is
installed
as a kernel module.

Can someone please advise, how does this approach compare to using
hrtimers or regular kernel timers? I am trying to implement a traffic shaper
that sends out packets on the network with very high time precision.

Thanks
Ashish


More information about the click mailing list