[asterisk-dev] Help needed for main/pbx.c

Stefan Schmidt sst at sil.at
Wed Nov 3 15:22:58 CDT 2010


Am 03.11.2010 20:58, schrieb Russell Bryant:
> Is ao2_find() actually being used in that code?  For some reason, I
> thought I remembered it not being used anywhere.  That's why I started
> by only using 1 bucket, since multiple didn't seem to provide any
> benefit.
> 

yes there are atleast 2 calls to get a hint searched by an extension
using ao2_find. i dont know if it would be that expensive just for the
hint container but maybe thats another 100 usec we can save ;)

> In the case of processing state changes, I'm not sure how we could make
> it any better.  Device state changes are always reported for a single
> device, and a hint can be mapped to multiple devices.  So, hashing on
> the device name isn't very useful.
> 
thats what i have done by using a container for the devices which each
has a link to its hint. By using a hash with the devicename i will get
multiple objects but i want all of them cause i need every hint which
links to this device.
this solution also makes it possible to use very long devices names or
many multiple devices in one hint.

i will bring this both patches together and maybe can put it into
reviewboard tomorrow.

best regards

stefan







More information about the asterisk-dev mailing list