Re: [AD] minor fix

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


Chris wrote:

Peter Wang wrote:

Anyway, the goal is to call the callbacks at an average rate of 100 times per second.


Shouldn't the code just call it as fast as possible while still giving away the cpu after every iteration of the timers? Granted a method like that on most system will result in a rate of ~100 times per second, but it also seems that some linux kernels have the option to change the speed of the kernel timer frequency, so it may be possible to get more if it effects the scheduler as well (though I haven't tested this).


I'm not entirely sure what you mean. The code in question is not so much to slow down the rate at which the callbacks are called, but to _catch up_ when necessary. At the end of each iteration the background thread blocks using select(), but it may not get the CPU back for some arbitrary amount of time. The errors in timing can accumulate, so we have to account for it.

Peter

PS. we're not talking about timers (they're in a different thread)





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