[Asterisk-Dev] ASTOBJ update

Matthew Boehm mboehm at cytelcom.com
Tue Dec 28 07:29:25 MST 2004


----- Original Message ----- 
From: "Kevin P. Fleming" <kpfleming at starnetworks.us>
To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
Sent: Monday, December 27, 2004 4:48 PM
Subject: [Asterisk-Dev] ASTOBJ update


> For those who saw the message exchange here yesterday and today, please
> see bug 3167 in Mantis.
>
> Mark and I had a long chat on IRC this morning, and he agreed with many
> of my suggested API changes. Those changes have been implemented in that
> bug, and the ASTOBJ API is now cleaner and more orthogonal. (Please
> don't misunderstand, I'm not in any way disparaging Mark's work <G>)
>
> That patch also paves the way for a future upgrade to rwlocks for ASTOBJ
> entities instead of mutexes; at this point it does not seem that that
> will be possible soon, but I am still researching it. If it can be done,
> it will be another big performance improvement, since many modules in
> Asterisk build lists of things and then primarily only read them, so
> being able to have multiple readers in parallel will solve a lot of
> contention problems.

For those of us who aren't hard-core C programmers, could someone explain
why/how the new macro-enabled code is better than before? An easy example is
here:

#define ASTOBJ_WRLOCK(object) ast_mutex_lock(&(object)->_lock)

Why is using this macro better than just calling the function? What kind of
performance gain is seen? Where is it seen?

Thanks,
Matthew




More information about the asterisk-dev mailing list