API explosion (Re: [RFC/RFT] calloutng)

Bruce Evans brde at optusnet.com.au
Wed Dec 19 14:07:00 UTC 2012


On Wed, 19 Dec 2012, Poul-Henning Kamp wrote:

> --------
> In message <20121219221518.E1082 at besplex.bde.org>, Bruce Evans writes:
>
>>> With this format you can specify callouts 68 years into the future
>>> with quarter nanosecond resolution, and you can trivially and
>>> efficiently compare dur_t's with
>>> 	if (d1 < d2)
>>
>> This would make a better general format than timevals, timespecs and
>> of course bintimes :-).
>
> Except that for absolute timescales, we're running out of the 32 bits
> integer part.

Except 32 bit time_t works until 2106 if it is unsigned.

> Bintimes is a necessary superset of the 32.32 which tries to work
> around the necessary but missing int96_t or int128_t[1].
>
> [1] A good addition to C would be a general multi-word integer type
> where you could ask for any int%d_t or uint%d_t you cared for, and
> have the compiler DTRT.  In difference from using a multiword-library,
> this would still give these types their natural integer behaviour.

That would be convenient, but bad for efficiency if it were actually
used much.

Bruce


More information about the freebsd-current mailing list