[linux-audio-user] Realtime Audio + Networking

Paul Davis paul at linuxaudiosystems.com
Wed Jun 7 08:53:53 EDT 2006


On Tue, 2006-06-06 at 14:31 -0400, Joshua Boyd wrote:
> setpriority(PRIO_PROCESS, 0, -20);
> 
> I was under the impression that that set priority to a "realtime"
> priority, although rereading the man page I don't see any specific
> correlation listed between -20 and realtime.

there is no relationship whatsoever.

> I also do: sched_setscheduler(0, SCHED_FIFO, &sp);

on POSIX-ish operating systems, there are two orthogonal aspects to
scheduling: scheduling class and scheduling priority. priority only
ranks different execution contexts (kernel threads) within the *same*
scheduling class - it has no impact when a scheduling decision has to be
made between two execution contexts in two different classes. put
differently, you can leave yourself in SCHED_OTHER (the default class)
and raise your priority to the maximum, but you will never ever be
scheduled to run if there is a SCHED_FIFO thread ready to run even if
its numerical priority is lower than yours.

there is no reason to use setpriority() for realtime work:
sched_setscheduler's parameter argument defines the priority.

--p





More information about the Linux-audio-user mailing list