[asterisk-dev] [Code Review] Use kqueue(2) to reduce CPU consumption in *BSD and Mac OS X

Tilghman Lesher tlesher at digium.com
Fri Mar 26 21:02:20 CDT 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/543/
-----------------------------------------------------------

(Updated 2010-03-26 21:02:20.533505)


Review request for Asterisk Developers.


Changes
-------

Upload latest patch.


Summary
-------

Currently, we use inotify(2), which is a Linux-only kernel API, to check as to whether timezone files have changed, which allows an admin to change the machine timezone on the fly, and we will reparse it.  The alternative currently is for us to sit in what is essentially a busy loop, checking whether a timezone file is changed.  For most situations, these files change very seldom, so this represents quite a bit of CPU consumption over the life of a process.

The BSDs (and Mac OS X) contain a similar interface, called kqueue(2).  This has been implemented for timezone files, which should conserve CPU usage while running Asterisk on those platforms.


Diffs (updated)
-----

  /trunk/Makefile 255109 
  /trunk/configure UNKNOWN 
  /trunk/configure.ac 255109 
  /trunk/include/asterisk/autoconfig.h.in 255109 
  /trunk/main/stdtime/localtime.c 255109 
  /trunk/tests/test_time.c 255109 

Diff: https://reviewboard.asterisk.org/r/543/diff


Testing
-------

None yet; wanted to get some eyes on this before testing started.


Thanks,

Tilghman




More information about the asterisk-dev mailing list