Re: [LONG]Strange Loop

From: Chris Gilbert (chris@buzzbee.freeserve.co.uk)
Date: 05/20/00


Benjamin Draper wrote:
>
>  Thank you Chris!
>
>  You're spot on with null_time being the problem. I'm not sure how,
> whether it's through select, or an overrun, it doesn't stay at 0 for
> very long. I took your advice and now have:
>
> >     do {
>         null_time.tv_sec = 0;
>         null_time.tv_usec = 0;
> >       circle_sleep(&timeout);
> >       gettimeofday(&now, (struct timezone *) 0);
> >       timediff(&timeout, &last_time, &now);
> >     } while (timeout.tv_usec || timeout.tv_sec);
> >
>
>  My tests were done using stock Circle30bpl16, so the only changes were
> the debug output, so perhaps your little addition should make it into
> bpl18? George?

Nope you've got a bug.  It's set to zero at the top of the function and
should never change, something is trashing the values there.  It maybe
trashing other values without you knowing as well.  it maybe a fix for
now, but you might want to add a log message when you enter the loop and
null_time isn't 0, see how often it happens, ie is there a pattern to
it.

(checking the select call, if it errors it actually just makes the
function return, so select messing it up would not get back to that
code...)

Cheers,
Chris


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT