Re: [linux-audio-dev] thread priority question

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] thread priority question
From: Paul Davis (paul_AT_linuxaudiosystems.com)
Date: Wed Apr 30 2003 - 19:46:06 EEST


>Is there an equivalent to sched_setscheduler() that adjusts thread priority in
>stead of process priority? I want my audio thread to be higher priority than
>my drawing thread. Both threads are part of the same app (process). Is this
>possible in Linux v2.5?

from the source code of jack/libjack/client.c

        if (pthread_attr_setschedpolicy (attributes, SCHED_FIFO)) {
                jack_error ("cannot set FIFO scheduling class for RT thread");
                return -1;
        }

        if (pthread_attr_setscope (attributes, PTHREAD_SCOPE_SYSTEM)) {
                jack_error ("Cannot set scheduling scope for RT thread");
                return -1;
        }

        memset (&rt_param, 0, sizeof (rt_param));
        rt_param.sched_priority = client->engine->client_priority;

        if (pthread_attr_setschedparam (attributes, &rt_param)) {
                jack_error ("Cannot set scheduling priority for RT thread (%s)", strerror (errno));
                return -1;
        }


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Apr 30 2003 - 20:13:02 EEST