[asterisk-dev] Help needed for main/pbx.c
Russell Bryant
russell at digium.com
Wed Nov 3 16:04:37 CDT 2010
On Wed, 2010-11-03 at 21:22 +0100, Stefan Schmidt wrote:
> 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 ;)
Oh, okay. Hashing on the unique extension adds some value, then.
> > 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.
>
Okay, so you have a container of _devices_ which link to one or more
hints. Are you using an ao2_callback() with OBJ_MULTIPLE to accomplish
that? That seems like it would work.
> i will bring this both patches together and maybe can put it into
> reviewboard tomorrow.
Sounds good! Thanks!
--
Russell Bryant
Digium, Inc. | Engineering Manager, Open Source Software
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
jabber: rbryant at digium.com -=- skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org
More information about the asterisk-dev
mailing list