> >> The two threads must run with SCHED_FIFO as they both need to complete
> >> their cycle before the next soundcard interrupt.
> > And even if they both run SCHED_FIFO, they should then also run at the
same
> > priority.
> 
> Not needed. The SCHED_FIFO protects against from other tasks taking the
> CPU. If we have two SCHED_FIFO threads communicating with a mutex
> protected queue, different priorities are not a problem as for priority
> inversion to happen, one of them needs to block on the shared mutex. And
> if the thread is blocked, it then isn\'t in the run queue, and thus cannot
> get the CPU.

Not true as far as I know. FIFO only means that the thread won\'t be preempted
after a certain time in case a thread of the same priority is ready to run.
AFAIK all threads running either SCHED_FIFO or SCHED_RR will always be
preempted by higher priority SCHED_* threads. Please correct me if I am wrong
in this.

--martijn



Powered by ASHosting

Reply via email to