There is a lot that could be said about this, but the patch is a big improvement for performance, stability, code maintainability, and ease of future code development. The channel list is no longer an unsorted linked list. The main container for channels is an astobj2 hash table. All of the code related to searching for channels or iterating active channels has been rewritten. Let n be the number of active channels. Iterating the channel list has gone from O(n^2) to O(n). Searching for a channel by name went from O(n) to O(1). Searching for a channel by extension is still O(n), but uses a new method for doing so, which is more efficient. The ast_channel object is now a reference counted object. The benefits here are plentiful. Some benefits directly related to issues in the previous code include: 1) When threads other than the channel thread owning a channel wanted access to a channel, it had to hold the lock on it to ensure that it didn't go away. This is no longer a requirement. Holding a reference is sufficient. 2) There are places that now require less dealing with channel locks. 3) There are places where channel locks are held for much shorter periods of time. 4) There are places where dealing with more than one channel at a time becomes _MUCH_ easier. ChanSpy is a great example of this. Writing code in the future that deals with multiple channels will be much easier. Some additional information regarding channel locking and reference count handling can be found in channel.h, where a new section has been added that discusses some of the rules associated with it. Mark Michelson also assisted with the development of this patch. He did the conversion of ChanSpy and introduced a new API, ast_autochan, which makes it much easier to deal with holding on to a channel pointer for an extended period of time and having it get automatically updated if the channel gets masqueraded. Mark was also a huge help in the code review process. Thanks to David Vossel for his assistance with this branch, as well. David did the conversion of the DAHDIScan application by making it become a wrapper for ChanSpy internally. The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch. Review: http://reviewboard.digium.com/r/203/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
53 lines
2.6 KiB
XML
53 lines
2.6 KiB
XML
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" remove_on_change=".lastclean">
|
|
<member name="DONT_OPTIMIZE" displayname="Disable Optimizations by the Compiler">
|
|
</member>
|
|
<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
|
|
</member>
|
|
<member name="STATIC_BUILD" displayname="Build static binaries">
|
|
</member>
|
|
<member name="LOADABLE_MODULES" displayname="Runtime module loading">
|
|
<defaultenabled>yes</defaultenabled>
|
|
</member>
|
|
<member name="DEBUG_FD_LEAKS" displayname="Enable File Descriptor Leak Detection">
|
|
</member>
|
|
<member name="LOW_MEMORY" displayname="Optimize for Low Memory Usage">
|
|
</member>
|
|
<member name="USE_HOARD_ALLOCATOR" displayname="Use the Hoard Memory Allocator instead of the default system one">
|
|
<defaultenabled>no</defaultenabled>
|
|
<depend>hoard</depend>
|
|
</member>
|
|
<member name="LOTS_OF_SPANS" displayname="More than 32 DAHDI spans">
|
|
</member>
|
|
<member name="RADIO_RELAX" displayname="Relax DTMF for Radio Applications">
|
|
</member>
|
|
<member name="G711_NEW_ALGORITHM" displayname="Use the NEW ulaw/alaw codecs (slower, but cleaner)">
|
|
<defaultenabled>no</defaultenabled>
|
|
</member>
|
|
<member name="G711_REDUCED_BRANCHING" displayname="New ulaw/alaw codec, reduced branching (might help it run faster in some architectures)">
|
|
<depend>G711_NEW_ALGORITHM</depend>
|
|
</member>
|
|
<member name="TEST_CODING_TABLES" displayname="New ulaw/alaw codec, turn on table tests on init">
|
|
<depend>G711_NEW_ALGORITHM</depend>
|
|
</member>
|
|
<member name="TEST_TANDEM_TRANSCODING" displayname="New ulaw/alaw codec, turn on transcoding tests on init">
|
|
<depend>G711_NEW_ALGORITHM</depend>
|
|
</member>
|
|
<member name="MALLOC_DEBUG" displayname="Keep Track of Memory Allocations">
|
|
</member>
|
|
<member name="BUSYDETECT_TONEONLY" displayname="Enable additional comparision of only the tone duration not the silence part">
|
|
<conflict>BUSYDETECT_COMPARE_TONE_AND_SILENCE</conflict>
|
|
<defaultenabled>no</defaultenabled>
|
|
</member>
|
|
<member name="BUSYDETECT_COMPARE_TONE_AND_SILENCE" displayname="Assume that tone and silence have the same duration">
|
|
<conflict>BUSYDETECT_TONEONLY</conflict>
|
|
<defaultenabled>no</defaultenabled>
|
|
</member>
|
|
<member name="BUSYDETECT_DEBUG" displayname="Enable additional busy detection debugging">
|
|
<defaultenabled>no</defaultenabled>
|
|
</member>
|
|
<member name="IAX_OLD_FIND" displayname="Use the old, slow method of searching for IAX callnos">
|
|
</member>
|
|
<member name="INTEGER_CALLERID" displayname="Use the (less accurate) integer-based method for decoding FSK tones (for embedded systems)">
|
|
</member>
|
|
</category>
|