[asterisk-dev] conflicting timer modules

Russell Bryant russell at digium.com
Mon Feb 16 07:14:01 CST 2009


Tzafrir Cohen wrote:
> Another question: what's the difference between the timerfd and the
> pthread modules? What are the pros and cons of using either?

res_timing_pthread is a timing module that is a bit of a hack, but 
provides timing using a background timing thread that pokes timing fds 
via a pipe at specified intervals.  It has proven to be the least 
efficient timing module, but works when DAHDI and the timerfd interfaces 
are not available.

The timerfd interface is something newer, and is only available in later 
versions of Linux 2.6.

On the subject of conflicting timer modules, I think we should just add 
a "priority" to each module that it provides when it registers itself. 
That way, you can load multiple timing modules, and the timing core will 
use the highest priority one.

I would order them:

1) res_timing_timerfd
2) res_timing_dahdi

  - Both are reliable timing sources, but DAHDi timing is subject to not 
working if DAHDi is not set up properly.  Also, for the common case of 
dahdi_dummy, it's better if we use the official kernel timing interface 
instead of our custom one.

3) res_timing_pthread

-- 
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list