[SDL] OpenGL or pure SDL gfx?
stephena at roadrunner.nf.net
Tue Sep 16 12:47:00 PDT 2003
On Tuesday 16 September 2003 02:46 pm, Bob Pendleton wrote:
> On Tue, 2003-09-16 at 11:14, Latimerius wrote:
> > On Sun, Sep 14, 2003 at 05:34:06PM -0500, Bob Pendleton wrote:
> > > Now days you are never the only process running,
> > Anyway, has anyone tried to play with SCHED_RR or SCHED_FIFO
> > scheduling priorities on Linux? (Windows might also offer ways to
> > bias scheduler?) I wonder whether this could help you get the CPU on
> > time ...
> The next version of the kernel is supposed to have much finer
> scheduling granularity and a much improved scheduler. May be best to
> just wait for it.
> Bob Pendleton
I can attest to that. I had numerous problems with 2.4 and an SDL based
emulator I'm working on. Basically the only way to get a constant
framerate (60 fps) was with a busy-wait, taking 100% of the CPU. I added
some code to get an *average* of 60 fps, and while it reduced CPU usage
to less than 10%, the updates weren't smooth anymore.
Now with kernel 2.6.0-test5, its actually much better to use the average
method. The busy-wait method causes the application to lose CPU time
(scheduled as a CPU hog), while the average method is virtually
indistinguishable from the 2.4 busy-wait. But of course the CPU usage
never goes above 5%. YMMV.
Now if I could only figure out why SDL_AUDIODRIVER=alsa causes CPU spikes
that make it practically useless, while OSS (under ALSA) emulation works
More information about the SDL