Realtime speeds (or close to) in Linux?

OK, so so far I’ve been stopping my litle program starving the sytem by
dropping SDL_Delay(1) into the main event loop but as it stands things
are running slower than I would like and I’m only using 15% CPU.

It’s great that there’s a whole ton of information for games programming
in Windows including how to maximise use of the CPU without starving the
system but I can’t find jack on doing this in Linux and I’ve looked in
many places including gpWiki and comp.os.linux.development.apps.

I’m sure there must be something out there that demonstrates how to do
this but it’s apparently beyond my ability to find so any help would be
very much appreciated.___________________________________________________________
To help you stay safe and secure online, we’ve developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

Are you by any chance running on an old (ie. 2.4) kernel? IIRC older
kernels had a godawful minimum process sleep resolution of 10ms, which
means all <10ms sleeps called were actually raised to 10ms.On 3/25/06, Paul Duffy wrote:

OK, so so far I’ve been stopping my litle program starving the sytem by
dropping SDL_Delay(1) into the main event loop but as it stands things
are running slower than I would like and I’m only using 15% CPU.

It’s great that there’s a whole ton of information for games programming
in Windows including how to maximise use of the CPU without starving the
system but I can’t find jack on doing this in Linux and I’ve looked in
many places including gpWiki and comp.os.linux.development.apps.

I’m sure there must be something out there that demonstrates how to do
this but it’s apparently beyond my ability to find so any help would be
very much appreciated.

  • SR

Is your program using OpenGL? I’ve seen it sometimes where a program
running at full speed will show low CPU utilisation. That’s just
because all the work is done by the graphic card. It used to be like
that when I had RedHat (8.x i think?) but now I’m using Slackware and
it does show close to 100% CPU usage when running an opengl process.

HTH,
SimonOn 3/25/06, Paul Duffy wrote:

OK, so so far I’ve been stopping my litle program starving the sytem by
dropping SDL_Delay(1) into the main event loop but as it stands things
are running slower than I would like and I’m only using 15% CPU.

It’s great that there’s a whole ton of information for games programming
in Windows including how to maximise use of the CPU without starving the
system but I can’t find jack on doing this in Linux and I’ve looked in
many places including gpWiki and comp.os.linux.development.apps.

I’m sure there must be something out there that demonstrates how to do
this but it’s apparently beyond my ability to find so any help would be
very much appreciated.


To help you stay safe and secure online, we’ve developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Probably not a great option for games, but one way on *nix to get every last free execution frame without bogging down the system is to make a call to nice() during initialization. Great for background processes that don’t need hard timing. The drawback is that most anything else using CPU gets priority.