From owner-freebsd-arch@FreeBSD.ORG Wed Nov 29 16:10:50 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 187A716A416 for ; Wed, 29 Nov 2006 16:10:50 +0000 (UTC) (envelope-from rnsanchez@wait4.org) Received: from spunkymail-a18.dreamhost.com (sd-green-bigip-211.dreamhost.com [208.97.132.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6035243CC9 for ; Wed, 29 Nov 2006 16:10:39 +0000 (GMT) (envelope-from rnsanchez@wait4.org) Received: from sauron.lan.box (unknown [200.180.183.74]) by spunkymail-a18.dreamhost.com (Postfix) with ESMTP id 224D95B522; Wed, 29 Nov 2006 08:10:34 -0800 (PST) Date: Wed, 29 Nov 2006 14:10:27 -0200 From: Ricardo Nabinger Sanchez To: "Poul-Henning Kamp" Message-Id: <20061129141027.5bd71945.rnsanchez@wait4.org> In-Reply-To: <8092.1164795707@critter.freebsd.dk> References: <20061128231010.cbdc4e1d.rnsanchez@wait4.org> <8092.1164795707@critter.freebsd.dk> Organization: SYS_WAIT4 X-Mailer: Sylpheed version 2.3.0beta2 (GTK+ 2.10.6; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re: a proposed callout API X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2006 16:10:50 -0000 On Wed, 29 Nov 2006 10:21:47 +0000 "Poul-Henning Kamp" wrote: > >> I had intended on using microseconds > >> with a negative value indicating a relative timeout (so an 'uptime' > >> timeout, i.e. trigger X us from now) and a positive value indicating an > >> absolute timeout (time_t-ish, and subject to ntp changes). > > > >Just some devil's advocate thoughts... > > > >What are the advantages of encoding some semantic in one or two bits of the > >argument, instead of passing another word with flags? > > The bits _will_ go in the flags argument I proposed. Yes, I recall from your first message about the proposed API. What confused me was that John explained a +useconds/-useconds encoding, and this microsecond bounding is what concerned me. It seems to me that it's too tight, given that 10G-E can get popular soon (5 or less years). If I understood your (phk) proposal, it is tick-ready---which I think is the natural way to go in order to handle high precision events. My concern is that microsecond resolution (if I understood John's proposal correctly) may seem right for now, but what about in 5 years? Promoting it to nanoseconds (also using 64-bit word) seems likely to happen, with some breakage. Also, regarding your encoding proposal, I think my argumentation in the previous message isn't valid, as the bit is used to determine the scale of the timeout in the remaining bits. It looks fine to me, as both tick-resolution and second-resolution (or longer) events are representable, probably being applicaple for a good time (I don't have any idea of how much time, but feel like it's a lot). -- Ricardo Nabinger Sanchez Powered by FreeBSD "Left to themselves, things tend to go from bad to worse."