[Asterisk-Dev] Bug 3203 "Get RT without runaway risk" revisited

Kristian Nielsen kn at sifira.dk
Fri Aug 5 10:48:52 MST 2005


Steve Kann <stevek at stevek.com> writes:

> I have this system working now, but we haven't been able to clean up
> and prettify the code to put it on mantis, but if anyone wants it, let
> me know.

BTW, on our systems which run some old RedHat version (not sure which at
the moment, sorry) and LinuxThreads, the asterisk realtime priority
option (-p) doesn't actually work. All threads created (except for the
main thread) run at non-realtime priority. The reason for this can be
found in "man 3 pthread_attr_setinheritsched":

   inheritsched
       Indicate whether the scheduling policy and scheduling parameters for
       the newly created thread are determined by the values of the schedpol-
       icy and schedparam attributes (value PTHREAD_EXPLICIT_SCHED) or are
       inherited from the parent thread (value PTHREAD_INHERIT_SCHED).

       Default value: PTHREAD_EXPLICIT_SCHED.

With the default, newly created threads take their realtime status from
the pthread_create() attributes, which default to non-realtime. I think
perhaps the ast_pthread_create_stack() is missing a call to
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED).

Did you experience this problem?

 - Kristian.

-- 
Kristian Nielsen   kn at sifira.dk
Development Manager, Sifira A/S




More information about the asterisk-dev mailing list