On Apr 17, 2006, at 3:38 PM, John M McIntosh wrote:
so if next wakeup tick is less than 16ms then call aioPoll(0) then nanosleep for upto 16ms ish then call aioPoll(0) mmm I guess that services any interrupt that woke things up. and if greater than 16ms you end up sleeping in select() via callling aioPoll(waitfor).
I couldn't have described it better.
mind I didn't look to see what handleEvents() does... Perhaps you never sleep?
handleEvents() returns 1 if any UI events came in (or if the event buffer is not empty), otherwise 0 to indicate no UI activity to worry about.
In other words, ioRelinquishProc only sleeps if there is no UI activity and no descriptor is ready for a pending i/o operation.
Any chance you could fold the nanosleep back into the aioPoll() logic instead of making it a special case outside of select logic in aioPoll()
Would this be particularly helpful to you? I never call aioPoll() with non-zero from anywhere except relinquishProc, so for me it's better being outside aioPoll. But if you'd find it useful inside aioPoll then I don't think moving it there would break anything.
Cheers, Ian