On Mon, Nov 23, 2009 at 10:42 AM, Lo'oris <[email protected]> wrote:
> Unless I'm missing something, the documentation doesn't take into
> account the possibility of schedule_interval failing to actually do
> what it's asked.
>
> Since in real word this can happen, what do I have to expect when
> there are other programs eating the cpu?
> Will it just skip some ticks? Will they queue up and be called in a
> non regular timing? What's going to happen?

As I understand the code, if the task does not get executed in time,
the next time it does execute, the scheduler will try to catch up by
scheduling the next one sooner, up to a certain threshold (i.e., it
won't schedule things in the past). So essentially your scheduled
thing will just get called less often than you expect if the OS does
not have enough cpu time to go around.

Since the time delta is passed to the scheduled callable, your code
can compensate according to this value. It's a good idea usually to
set an upper limit on how much compensation you do, however. In games
where physics is driven by the scheduler in this way, long time deltas
can make things unstable or unplayable. Lowering the framerate and
game speed at least lets the player continue with a degraded
experience rather than an unplayable one.

-Casey

--

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=.


Reply via email to