Re: [PATCH] Hot idle

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 12 Sep 2013 23:17:21 -0600

On 09/12/2013 07:43 PM, Amos Jeffries wrote:
> On 13/09/2013 4:48 a.m., Alex Rousskov wrote:

> +EventScheduler::timeRemaining() const
> {
> + if (tasks) {
> + const int diff = static_cast<int>((tasks->when - current_dtime) * 1000);
> + return max(diff, 0);
> + }
> + return EVENT_IDLE;
> }

...

> + int result = timeRemaining();
> + if (result != 0)
> + return result;
> + do {
> + ev_entry *event = tasks;
> + assert(event);

> Please do not add an assertion into the main event loop.

Why not? I think it is appropriate in this context. I do not think it
will trigger today, but if we screw up timeRemaining() so that it gets
out of sync again, the assertion will trigger (and probably often!).

> And thank you, this kind of explains the mystery 100% CPU reports still
> coming in and unable to be replicated.

One could only hope. While it is possible that this is the culprit, I
suspect it is not, unfortunately -- a lot of things must align just
right for this problem to cause persistent 100% CPU usage AFAICT.

Thank you,

Alex.
Received on Fri Sep 13 2013 - 05:17:30 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 27 2013 - 12:00:11 MDT