From owner-freebsd-current@FreeBSD.ORG Tue Dec 18 17:51:33 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31BF43EC; Tue, 18 Dec 2012 17:51:33 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id DAAE08FC0C; Tue, 18 Dec 2012 17:51:32 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id AC5847300A; Tue, 18 Dec 2012 18:50:13 +0100 (CET) Date: Tue, 18 Dec 2012 18:50:13 +0100 From: Luigi Rizzo To: Alexander Motin Subject: Re: API explosion (Re: [RFC/RFT] calloutng) Message-ID: <20121218175013.GB94266@onelab2.iet.unipi.it> References: <50CF88B9.6040004@FreeBSD.org> <20121218173643.GA94266@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121218173643.GA94266@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i Cc: Davide Italiano , freebsd-current , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2012 17:51:33 -0000 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