Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Dec 2012 18:50:13 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        Davide Italiano <davide@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: API explosion (Re: [RFC/RFT] calloutng)
Message-ID:  <20121218175013.GB94266@onelab2.iet.unipi.it>
In-Reply-To: <20121218173643.GA94266@onelab2.iet.unipi.it>
References:  <50CF88B9.6040004@FreeBSD.org> <20121218173643.GA94266@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 18, 2012 at 06:36:43PM +0100, Luigi Rizzo wrote:
> On Mon, Dec 17, 2012 at 11:03:53PM +0200, Alexander Motin wrote:
...
> So I believe my proposal would give large simplifications in
> the code and lead to a much cleaner implementation of what
> you have designed:
> 
> 1. acknowledge the fact that the only representation of time
>    that callouts use internally is a bintime+precision, define one
>    single function (instead of two or three or six) that implements
>    the blessed API, and implement the others with macros or
>    inline functions doing the appropriate conversions;
> 
> 2. specifically, the *_flags() variant has no reason to exist.
>    It can be implemented through the *_bt() variant, and
>    being a new function the only places where you introduce it
>    require manual modifications so you can directly invoke
>    the new function.

to clarify: i am not sure if now the *_bt() variant takes flags too,
but my point is that the main API function should take all
supported arguments (including flags) and others should
simply be regarded as simplified versions. More or less what
we have for sockets, with send() and sendmsg() and friend

cheers
luigi



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