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

Alex Massover alex at jajah.com
Wed Mar 10 02:21:57 CST 2010


Hi,

have you considered libev to provide a cross-platform abstraction for that? Looks to be much more easier. Although kqueue is not supported but as far as I understood it's not a busy loop.

On the other hand your already implemented all low level functionality with inotify and kqueue.

http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_stat_code_did_the_file_attri

> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com [mailto:asterisk-dev-
> bounces at lists.digium.com] On Behalf Of Tilghman Lesher
> Sent: יום ו 05 מרץ 2010 21:47
> To: Tilghman Lesher; Asterisk Developers
> Subject: [asterisk-dev] [Code Review] Use kqueue(2) to reduce CPU
> consumption in *BSD and Mac OS X
> 
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/543/
> -----------------------------------------------------------
> 
> Review request for Asterisk Developers.
> 
> 
> 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
> -----
> 
>   /trunk/configure UNKNOWN
>   /trunk/configure.ac 250912
>   /trunk/include/asterisk/autoconfig.h.in 250912
>   /trunk/main/stdtime/localtime.c 250912
> 
> Diff: https://reviewboard.asterisk.org/r/543/diff
> 
> 
> Testing
> -------
> 
> None yet; wanted to get some eyes on this before testing started.
> 
> 
> Thanks,
> 
> Tilghman
> 
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> This mail was received via Mail-SeCure System.
> 


This mail was sent via Mail-SeCure System.





More information about the asterisk-dev mailing list