Re: Jiffies Wraparound

Ingo Molnar (mingo@pc5829.hil.siemens.at)
Thu, 22 Aug 1996 08:39:22 +0200 (MET DST)


On Wed, 21 Aug 1996, Richard Henderson wrote:

> > #define IS_TIMED_OUT(timeout) (jiffies>timeout) || \
> > (timeout-jiffies>MAX_JIFFIES/2)

> start = jiffies;
> while (jiffies - start < delay) continue;
>
> solves the problem, and is much faster.

I was thinking of MAX_JIFFIES as an arbitary number, thus the "a
wraparound every 5 minutes" could be done by redefining MAX_JIFFIES. But
yes, this isnt worth it.

Anyways, using a macro would be better IMHO, because "good" code would
be easy to separate from "broken" code.

-- mingo