Re: [AD] rest and yield_timeslice |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Angelo Mottola wrote:
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.
I third most of this. I agree yield_timeslice should be reverted to the old behavior of actually yielding, as well rest should give up the cpu while waiting.
However, I don't agree that rest(0) should yield the timeslice. IMO, rest(0) should just return immediately since that's what one would expect.. rest for 0ms (eg. not rest). The rest function has never been directly related to the system scheduler or timeslice, nor should it. As such, yield_timeslice should not be depricated.
Giving up the CPU and giving up the timeslice are two seperate things. The former is what you do when you have nothing better to do (ie. let the system idle). The latter is what you do when you want other programs to behave efficiently along side your own program.
- Kitty Cat
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |