[asterisk-dev] Asterisk Media Performance

Joshua Colp jcolp at digium.com
Mon Jan 6 12:20:59 CST 2014


David Lee (digium) wrote:
>
> Synchronizing the notifications with the format change may be tricky. If
> we’re not careful, we could end up in the situation where 1) the format
> changes but some bit of code gets the notification about the change too
> late or 2) we end up with extra locks/contention in the media path due
> to format change notifications.

I think we can actually do it using a control frame. The stuff that 
cares about the format would be in that path, and the control frame 
could just be in front of the frame with the new format. As it passes 
through stuff can change accordingly (change formats, smoother, etc).

> Another option would be structuring ast_format so that comparisons are
> cheap. If it’s a refcounted immutable object, we might even be able to
> do it simply with a pointer comparison (or, at the very least, the
> compare function can be fast if comparing an ast_format with itself).

Agreed. I think regardless of the above reactive versus notification 
this has to be fast.

> Of course, I say that without actually looking at the code. Maybe there
> are other reasons to switch from reactive to notifications, or my
> concerns about extra locks and late notifications are just FUD. Just
> something to think about.

By responding to your email I can confirm that I have thought about it 
at least briefly.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org



More information about the asterisk-dev mailing list