[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testing out the scheduler



On Wed, 1 Sep 1999, Lloyd Wood wrote:

> On 1 Sep 1999, Yuri Pryadkin wrote:
> 
> > Should be working now.  One of my optimizations backfired, sorry about
> > that.  Just update your scheduler.cc,  I checked it in yesterday.
> 
> Okay, we're now back to 24-hour satellite scripts stopping at
> 86341.blah seconds, instead of the 86400 seconds specified in the
> script, as before.

...which is correct, since 86400 - 60 (the spacing of the CBR fires) =
86340, and the CBR starts at time 1, not 0, so you won't see an
enque/deque at 86400. Doh!

Had a look at scheduler.cc. (Funny, I seem to be spending all my time
reading and fiddling with .cc files these days. It's a treacherous
path...) Call me bloodily literal-minded if you like, but when the
comments in scheduler.cc say

        /* (e->time_ * oneonwidth) needs to be less than the
         * largest integer on the machine for the mapping
         * of time to bucket to work properly.  if it is not
         * we need to re-calculate the width.
         */

surely e.g.

if (e->time_ * oneonwidth_ > ULONG_MAX) {

and the other ULONG comparisons should be e.g.

if (e->time_ * oneonwidth_ >= ULONG_MAX) {

to obey that comment properly? This appears to tally with expected use
as documented in some versions of limits.h; see e.g.

http://www.dinkumware.com/htm_cl/limits.html

and I'm now eyeing every unequal inequality with equal suspicion...

thanks,

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>