[SDL] Blitting Issue

Steffen Hunt quakeboy at comcast.net
Mon Nov 24 12:51:08 PST 2003

On Mon, Nov 10, 2003 at 09:13:21PM +0100, Torsten Giebl wrote:
> > Nope.  Windows 2000, Windows XP and the Linux 2.6 kernel have fine-
> > grained scheduling.  They'll do 1ms sleeps without busy looping.
> But is it possible to get the actual size without
> including the Kernel Sources :-???

The kernel source isn't going to get you the scheduling resolution.  Binaries
aren't always going to be run on the same kernel they were compiled with.

I don't know what you're doing that you want the scheduling resolution
for.  I adjust sound writeahead based on it: I call uname(), and use a
small writeahead for 2.6 kernels (1ms sched) and a big one for 2.6
kernels (10ms sched).  I don't try to do it "generically", because this
is inherently a specialized platform optimization.  (2k has a good
scheduling resolution, but the crappy sound drivers generally make small
writeaheads not work anyway.)

When things get this low-level, I tend to take over and call native
APIs.  SDL is a reasonable high-level API for simple applications, but
for a well-tuned cross-platform game that wants to adjust based on things
like scheduling resolution, it's time to stop going through a middleman.

Glenn Maynard

More information about the SDL mailing list