On 3/5/08, Ben Sizer <[EMAIL PROTECTED]> wrote:
>
>  On Mar 4, 8:58 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote:
>
> > On Wed, Mar 5, 2008 at 2:13 AM, Ben Sizer <[EMAIL PROTECTED]> wrote:
>  > >  Do either of these methods guaranteed to get called as often as they
>  > >  would if you put them directly into your own game loop?
>  >
>  > There's no such guarantee -- if you're ignoring user input and
>  > rendering something trivial to a single window (worst case for
>  > EventLoop) you can measure a small performance degradation (you would
>  > not notice it).  For any app with non-trivial rendering, multiple
>  > windows, or that responds to mouse events, EventLoop is either not
>  > measurably different or is more responsive.
>
>
> I guess what I was worried about is that interrupt-based scheduling is
>  only as accurate as the resolution of the context switching on the OS
>  you're on. Asking for something to be polled 75 times a second
>  typically doesn't get you that many executions, due to sleep() calls
>  overrunning and so on, whereas putting that in a loop that happens to
>  be fast enough to execute 75 times a second would be fine.
>
>  However, having just looked at clock.py, and seen the effort you've
>  gone to in order to mitigate this (SetWaitableTimer on Windows,
>  considering using busy-waits rather than overrunning), I'm reassured
>  that it would probably work about as well as is possible. I look
>  forward to testing it soon!

Right.  The event loop is quite a different problem than the clock
scheduling (though they appear tightly coupled from the user's point
of view, implementation-wise they use different areas of the Windows
API).  The pyglet.app event loop degenerates into a polling loop when
scheduled items on the clock are unlikely to be fulfilled by the OS
fast enough.  Hence, the only slowdown is from the overhead of the
extra logic, which is really quite negligible.

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to