chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] current-time on 32-bit hardware


From: Nicolas Pelletier
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Fri, 30 Jul 2010 15:09:42 +0900

From: Peter Bex <address@hidden>
Subject: Re: [Chicken-users] current-time on 32-bit hardware
Date: Thu, 29 Jul 2010 11:01:26 +0200
On Thu, Jul 29, 2010 at 7:12 PM, Felix
<address@hidden> wrote:

Peter Bex <address@hidden> wrote:
> > I'd suggest you use numbers but I don't think thread-sleep! accepts
> > bignums.

Felix <address@hidden>replied:
> That won't change anything.

You are right, and using only small values for timeouts does not help either.

> No, the reason for this is that the scheduler uses fixnums in timeout
> checks for performance reasons and because of this, the time objects
> store time spans as fixnums as well. This will probably have to be
> changed to use flonums.

I am currently looking at ##sys#schedule. The time-out queue only
needs to hold time offsets from "now". I suppose the reason for having
"now" (aka ##sys#fudge 16) sitting around here is to find out whether
C_msleep slept too long and fire the events the scheduler might have
missed. But since there are no guaranties from the OS that we will not
actually sleep a bit too much, I'm thinking of representing the
current point in time with a plain 0 and replacing (if (>= now tmo1)
...) by (if (>= how-much-i-slept tmo1) ...), with how-much-i-slept
being the time I asked to sleep for.

I expect thus to be able to still use fixnums to represent time-outs
while avoiding the "13 days since startup" issue. The maximum for
time-outs would then be 2**29 ms, or 6 days 5 hours or so, which does
not sound as a limitation to me.

Does anybody have any objections to this?

Regards,

-- 
Nicolas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]