<html><head><style type='text/css'>p { margin: 0; }</style><style type='text/css'>body { font-family: 'Arial'; font-size: 10pt; color: #000000}</style></head><body>Hello!<br><br>I think I have completed the fix for bug 6002, and anyone interested is <br>invited to review and/or test the code. I explained in a previous mailing <br>what the algorithm would do, so you may wish to review the bug:<br><br>http://bugs.digium.com/view.php?id=6002<br><br>And my earlier letter:<br><br>http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html<br><br>The branch containing the fixes for 6002:<br><br>&nbsp;http://svn.digium.com/svn/asterisk/team/murf/bug6002<br><br><br>The fixes themselves involve changes to these files:<br><br>Index: pbx/pbx_config.c<br>Index: pbx/pbx_ael.c<br>Index: channels/chan_zap.c<br>Index: channels/chan_sip.c<br>Index: channels/chan_iax2.c<br>Index: channels/chan_skinny.c<br>Index: channels/chan_local.c<br>Index: apps/app_meetme.c<br>Index: apps/app_dial.c<br>Index: apps/app_queue.c<br>Index: include/asterisk/_private.h<br>Index: include/asterisk/pbx.h<br>Index: include/asterisk/pval.h<br>Index: main/channel.c<br>Index: main/features.c<br>Index: main/asterisk.c<br>Index: main/autoservice.c<br>Index: main/pbx.c<br>Index: res/ael/pval.c<br>Index: res/ael/ael.tab.c<br>Index: res/ael/ael.y<br>Index: res/ael/ael_lex.c<br>Index: res/ael/ael.tab.h<br>Index: res/ael/ael.flex<br>Index: utils/ael_main.c<br>Index: utils/extconf.c<br>Index: utils/conf2ael.c<br>Index: utils/Makefile<br><br>The scope of the fixes seems a bit extensive, but because I decided it would be better<br>to modify the interface to the AEL parser, the stuff in utils was affected, as well as the stuff in <br>res/ael.<br><br>All aps and channel drivers that added contexts or extensions to the <br>dialplan had to be slightly tweaked as to how they did it.<br><br>Results:<br><br>I wanted to reduce the time that the dialplan was locked during a merge_contexts_and_delete()<br>call. In this, I was successful. For my tiny test dialplan, I reduced the write-lock time from<br>roughly 43 microseconds, to 3-6 microseconds.<br><br>You may not be very impressed that I could reduce the lock-down time from 43 to 3-6 microseconds,<br>but you have to realize that this is a SMALL dialplan. I dialplan with 10-20 K priorities will have <br>substantially larger lock-down times. Especially if it has lots and lots of contexts. But it will always<br>have a lock-down time of 3-6 microseconds.<br><br>Well, I take that back. Actually, I've reduced the lock-down time to the time to change 2 pointers,<br>and save, and then restore the hint data. If you have a lot of hints, that will slow down the merge<br>time.<br><br>Now, also keep in mind that the new algorithm requires a lot more processing. The bulk of it, though, is done outside the lock-down period. For my small test dialplan, the total time to perform merge_contexts_and_delete() is about 31000 microseconds (about 700 times slower).&nbsp; Again,<br>only 3-6 of those microseconds were spent locked down, so (at least to me) the extra time <br>is not spent in a critical path, so it's not a big deal.<br><br>By the way, my tiny test dialplan is 47 contexts, 240 extensions, 624 priorities, most of them in AEL,<br>about 15 or so contexts in extensions.conf.<br><br>I've thrashed this code with reloads ("dialplan reload", and "ael reload"), and "stop gracefully".<br>I've spec'd :"regcontext=xxx" in sip.conf, and also had the xxx context in AEL. I've verified that<br>priorities registered in the name of "sip", but attached to a context with registrar of "pbx_ael" were not<br>lost when AEL reloaded. Duplicate contexts are no longer possible.<br><br>Any other acid tests you'd like to perform, now is the time, or suffer when this stuff gets merged into trunk.<br><br>murf<br><br>-- <br>Steve&nbsp;Murphy<br>Software&nbsp;Developer<br>Digium<br></body></html>