chicken-meisters
[Top][All Lists]
Advanced

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

Re: [Chicken-meisters] Restart of apache required


From: Peter Bex
Subject: Re: [Chicken-meisters] Restart of apache required
Date: Wed, 11 May 2011 17:17:54 +0200
User-agent: Mutt/1.4.2.3i

On Wed, May 11, 2011 at 08:30:17AM -0400, Felix wrote:
> Ugh. This is the implementation of C_milliseconds, which is used
> by current-milliseconds:
> 
>     struct timeval tv;
> 
>     if(C_gettimeofday(&tv, NULL) == -1) return 0;
>     else return (tv.tv_sec - C_startup_time_seconds) * 1000 + tv.tv_usec / 
> 1000;
> 
> I think I forgot to cast to double before doing the arithmetic, right?

I don't know. C's type rules confuse me.  It makes sense though.
I see you're implemented a fix.  Does this always return doubles on
32-bits platforms, even when overwriting C_startup_time_seconds like
I did?  If so, we might have solved this particular "Spiffy hanging" bug.

> > On the other hand, when I call current-seconds, it returns a greater
> > number (is that right?) and it does go into flonum mode immediately
> > on startup:
> > #;2> (current-seconds)
> > 1305112661.0
> 
> current-seconds uses time(NULL), current-milliseconds uses
> gettimeofday and returns the uptime of the process (sort of).

Ah, that's a bit confusing.  The names imply that one is just more
precise than the other.

> (btw, shouldn't discussions like this go to chicken-hackers?)

We've digressed a bit from the "Spiffy is crashing" issue, so maybe
this should.  I don't think it's a huge problem to have it here.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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