Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 12:11:52 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Davide Italiano <davide@freebsd.org>
Cc:        Ian Lepore <freebsd@damnhippie.dyndns.org>, phk@onelab2.iet.unipi.it, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: API explosion (Re: [RFC/RFT] calloutng)
Message-ID:  <50D192E8.3020704@FreeBSD.org>
In-Reply-To: <CACYV=-Eg542iHm9KfujPvCzZrA4TqepEBVA8RzT1YOHnCgfJnA@mail.gmail.com>
References:  <50CF88B9.6040004@FreeBSD.org> <20121218173643.GA94266@onelab2.iet.unipi.it> <50D0B00D.8090002@FreeBSD.org> <50D0E42B.6030605@FreeBSD.org> <20121218225823.GA96962@onelab2.iet.unipi.it> <1355873265.1198.183.camel@revolution.hippie.lan> <14604.1355910848@critter.freebsd.dk> <CACYV=-Eg542iHm9KfujPvCzZrA4TqepEBVA8RzT1YOHnCgfJnA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 19.12.2012 12:03, Davide Italiano wrote:
> On Wed, Dec 19, 2012 at 1:54 AM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
>> --------
>> In message <1355873265.1198.183.camel@revolution.hippie.lan>, Ian Lepore writes
>> :
>>> On Tue, 2012-12-18 at 23:58 +0100, Luigi Rizzo wrote:
>>
>>> I'm not so sure about the 2^k precision.  You speak of seconds, but I
>>> would be worrying about sub-second precision in my work.
>>
>> It is a bad idea, and it is physically pointless, given the stabilities
>> of the timebases available for computers in general.
>>
>> Please just take my word as a time-nut, and use a 32.32 binary format
>> in seconds (see previous email) and be done with it.
>
> Right now -- the precision is specified in 'bintime', which is a binary number.
> It's not 32.32, it's 32.64 or 64.64 depending on the size of time_t in
> the specific platform.
> I do not really think it worth to create another structure for
> handling time (e.g. struct bintime32), as it will lead to code
> duplication for all the basic conversion/math operation. On the other
> hand, 32.32 may not be enough in the long future.
> What do you think about that?

Linux uses 32.32 format in their eventtimers code. Respecting that now 
we have no any timer hardware with frequency about 4GHz, that precision 
is probably sufficient. But if at some point we want to be able to 
handle absolute wall time, then 32bit integer part may be not enough. 
Then we return to the question: "how many different data types do we 
want to see in one subsystem"? Sure, using single 64bit value would be 
much easier then struct bintime from many perspectives, but what's about 
the edge cases?

-- 
Alexander Motin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50D192E8.3020704>