Subject: [linux-audio-dev] SCHED_FIFO versus SCHED_RR
From: Phil Burk (philburk_AT_softsynth.com)
Date: Tue Nov 27 2001 - 01:30:01 EET
THANKs to all who responded. The effect of bumping the priority was so
dramatic that I really need to do it. I now understand it enough to feel
safe about it.
> SCHED_RR is designed for situations where there are several
> "real time" kernel threads and you wish to ensure that they all get
> time on the processor, regardless of their own intentions. the RR
> stands for "round robin". SCHED_FIFO is different in that once a
> thread is running, it will run forever, or until it yields, blocks or
> a higher priority SCHED_FIFO thread is runnable.
It sounds like SCHED_RR is a bit more polite. I wouldn't want a monster
synthesis thread to hog the CPU and lock out everything else. I guess with
Round Robin that equal priority threads at least get a chance to run. I want
equal priority threads to timeslice with my task.
> >Q: I have code that throttles back if I consume too much CPU time. Is
that
> >sufficient?
> sufficient for what?
Sufficient to not lock people out of their machine.
> >Q: Can I safely use the value from sched_get_priority_max(SCHED_FIFO) or
> >should I use less?
>
> its up to you. if you use the max value, its impossible for anyone to
> ever kill you if your thread gets stuck in a loop.
Maybe I'll use max-2 so others can get ahead of me and kick me out. (I saw a
bug report that threads with N+1 priority could not preempt priority N
threads. So I'll use max-2 instead of max-1).
Phil Burk
This archive was generated by hypermail 2b28 : Tue Nov 27 2001 - 01:30:09 EET