SDL and SCHED_FIFO

Hi,

I would like to know if I can safely use

sched_setscheduler (0, SCHED_FIFO, &sp);

within a program using SDL to display pictures and play sounds.

I need to pool the parallel port to detect events that may last only a
few msec, and I intend to do that in a thread that waits on the rtc
interrupt.

Thanks for letting me know if there are problems I may have overlooked.

(Oh, by the way, I believe I will be using fbcon rather than X, if that
makes a difference)

Christophe Pallier

Pallier Christophe wrote:

I would like to know if I can safely use

sched_setscheduler (0, SCHED_FIFO, &sp);

within a program using SDL to display pictures and play sounds.

if you know what you are doing, sure. There are no SDL-specific issues
involved (other than it being completely nonportable)

As long as you don’t change the policy for the thread doing the SDL
calls, there shouldn’t be any problems.

(Using X and probably some other video drivers from within SCHED_FIFO
threads can occasionally lock up you system. Same thing with running X as
SCHED_FIFO. Anyway, doing that kind of stuff from within your real time
thread will just ruin timing, as most calls make your thread depend on
non-real time resources.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Friday 26 October 2001 10:58, Pallier Christophe wrote:

Hi,

I would like to know if I can safely use

sched_setscheduler (0, SCHED_FIFO, &sp);

within a program using SDL to display pictures and play sounds.