[SDL] sleeping better for lower latencies (and other things)
Bob Pendleton
bob at pendleton.com
Tue May 13 08:28:27 PDT 2008
On Tue, May 13, 2008 at 9:40 AM, Pierre Phaneuf <pphaneuf at gmail.com> wrote:
> On Tue, May 13, 2008 at 10:23 AM, Bob Pendleton <bob at pendleton.com> wrote:
>
> > This has all been discussed before, and before, and before... :-) It is
> the
> > way it is because it is plenty good enough and it can be made to work
> > everywhere while "better" solutions only work on some operating system.
> See
> > my FastEvents library at gameprogrammer.com to see my reaction (and
> > solution) to the problem on the platforms I care about. Wow, I just
> checked,
> > that stuff is six years old now.
>
> That's one of the things I'd be interested in, a pointer to previous
> discussions where this is explained (no sense in explaining it
> again!).
>
> Although while I can think of many radical improvements (which could
> possibly work only on some platforms), I think we could fix up
> SDL_WaitEvent to be a bit more reasonable on a few platforms, where it
> could fall back to the current methods on those platforms where it
> wouldn't work.
>
> I'm a bit disappointed at the "lowest common denominator" that we're
> getting sometimes, for example how events can be lost with SDL even if
> we are on a platform that never loses events (which is most of them).
> I guess that's the price of portability...
Here's the thing; you can lose events in SDL, but you don't. It is very
difficult to actually lose events because it can only happen when your code
is running to slow to be useful. One other point, it is possible to lose
events on all platforms. Yes, the probability of losing events is very low,
but any system with finite memory can lose events. Many device handlers for
verbose devices such as mice and tablets are written to merge events (i.e.
throw them away) just to prevent the software from having to handle so many
events.
Look at my stuff, I think you will like it. A lot of people use it to reduce
latency and increase reliability on Linux and Windows. I have reports of it
working on the Mac as well.
Bob Pendleton
>
>
> --
> http://pphaneuf.livejournal.com/
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
--
+ Bob Pendleton: writer and programmer
+ email: Bob at Pendleton.com
+ web: www.GameProgrammer.com
+ www.Wise2Food.com
+--------------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080513/5e27f9aa/attachment.htm>
More information about the SDL
mailing list