Re: [AD] proposal: al_sleep()

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


 And I still haven't found any reason why I would want the
sched_yield behavior - it just causes the CPU to heat up for no reason
in idle Allegro programs.


sleep(1) on win32 tends to sleep approx 10 unless the timeBeginPeriod(1) is set. so unless the user or allegro uses the timeBeginPeriod(1) the user is not going to get 1ms sleep, but 10ms.
this will cause sluggish response.
on faster and ever faster CPU's, where we demand more processing, sleep 10ms is a very long time.

(use of timeBeginPeriod(1) also has some side effects, so if allegro is to implement it, these side effects must be considered).

yeild_timeslice() is not supposed to be used to sleep your app... its all about allowing other apps to run if they want.
if your trying to sleep your app then use sleep(>0).
so i think yeild_timeslice() is still a very important function.. how you call it ie al_sleep(0) is still a good idea.






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