[asterisk-dev] "Generic" or "Core" scheduler thread?
Steve Davies
davies147 at gmail.com
Fri Jun 3 11:27:10 CDT 2011
On 3 June 2011 16:30, Russell Bryant <russell at digium.com> wrote:
> On 06/03/2011 10:02 AM, Steve Davies wrote:
>> I looked through the source, and could not see one, but is there a
>> thread than handles some kind of "generic" scheduler that can be used
>> by the PBX, or other parts of Asterisk core, in order to
>> asynchronously clean up some data structures?
>>
>> Specifically, I would like to schedule an ast_channel_free(c) of a
>> zombie channel so that it occurs "real soon", but not right now, while
>> I have a handful of deadlock causing locks to contend with.
>
> No, there is no generic scheduler thread (yet). It has crossed my mind
> before, though...
>
> Take a look at include/asterisk/sched.h. It would be fairly straight
> forward to add. You would just allocate a scheduler context and then
> run ast_sched_start_thread() on it.
>
Thanks. I think it might be a bit over-the-top to start a thread just
to do some /very/ rare cleanup, so I'll go with a light-weight
compromise for now.
OTOH, I would be interested to see a generic thread being started for
"core" services in 1.10, even if it is not yet used.
Regards,
Steve
More information about the asterisk-dev
mailing list