[asterisk-dev] [Code Review] Split up SIP UDP receiving and proceeding
Mark Michelson
mmichelson at digium.com
Sat Oct 9 23:15:04 CDT 2010
On 10/09/2010 06:06 PM, Russell Bryant wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/970/#review2819
> -----------------------------------------------------------
>
>
> I haven't looked at the code yet, but as a general comment, if you want to split up UDP packet processing and scheduler processing, I think moving the scheduler into its own thread makes more sense. That way, you don't have to do so much copying of data and then signaling another thread for each packet that comes in.
>
> Moving the scheduler to its own thread shouldn't be too hard. I've done it once before, but got crashes with load testing. It was a long time ago, though. There is an ast_sched_thread API you can use to automatically handle the scheduler thread. However, it does require touching a lot of places in chan_sip that schedule callbacks.
>
> I've actually been thinking about re-doing how ast_sched_thread works. I'd like to get rid of the sched_thread data structure and instead just optionally have the thread data in the sched_context. I'd like to be able to use all of the same API calls for the scheduler, but just have an optional API call to start running a thread on a scheduler context. If we did that, the changes to chan_sip to put the scheduler in its own thread would be _trivial_.
>
> - Russell
>
FWIW, the suggestions in your final paragraph get a hearty +1 from me.
Mark Michelson
More information about the asterisk-dev
mailing list