Re: [AD] rest and yield_timeslice

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


There was already a discussion about this - but somehow it was only
about yield_timeslice and my "al_sleep", and rest was mostly left out of
it. After some discussion in #allegro today I got convinced that a
better idea would have been to just use rest() as function to give up
time.

I second all this.
Let me add the timer drivers already feature a rest() hook, even though as already stated not all drivers implement it. If we can get all drivers to provide it, we could use rest() with the following declared new behaviour: rest(n) waits n milliseconds, with accurate timing if possible, and gives up CPU cycles during the wait if possible.

This new rest() could be even used in place of the current new yield_timeslice() which was modified to actually sleep, and that some people never liked here... We could modify yield_timeslice() to just call the new rest() passing 0 as argument, as most systems do a context switch when calling a sleep function.

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/