From owner-freebsd-arch Mon Oct 7 23:40:21 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E7BA37B407; Mon, 7 Oct 2002 23:40:20 -0700 (PDT) Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD31E43E42; Mon, 7 Oct 2002 23:40:19 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021008064019.CZES18767.rwcrmhc53.attbi.com@InterJet.elischer.org>; Tue, 8 Oct 2002 06:40:19 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id XAA38161; Mon, 7 Oct 2002 23:33:21 -0700 (PDT) Date: Mon, 7 Oct 2002 23:33:20 -0700 (PDT) From: Julian Elischer To: Don Lewis Cc: nate@root.org, tlambert2@mindspring.com, sam@errno.com, freebsd-arch@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: CFR: m_tag patch In-Reply-To: <200210080606.g9866OvU034411@gw.catspoiler.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 7 Oct 2002, Don Lewis wrote: > On 7 Oct, Nate Lawson wrote: > > On Mon, 7 Oct 2002, Julian Elischer wrote: > > >> it is just working on the principal that there is not going to be > >> a collision in the 32 bit space. Especially when we create them from > >> "time since the epoch", and when teh various authors can see each > >> other's choices of value. > > > > There are deterministic ways to generate them. > > 1. A counter -- gettag() { return tag++; } > > 2. A LCRG -- gettag() { return (A * tag) % n; } > > 3. A global registry -- "Hey, gimme a major" > > > > There are non-deterministic ways as well, i.e. hash functions and > > PRNGs. And if code can run faster than a given time source, the output of > > that source or permutation thereof can produce collisions. > > > > What leads you towards the time-based option vs. the others, especially > > the deterministic ones? > > Why not name them? At boot or module load time stuff the name in a > table and use the table index as the 16 bit ID. Is there any reason the > ID has to be the same each time the system is booted? I want to be able to specify an OLD API and the NEW version if I can only get a particular node in object form, and I knowi uses the old version, and some other code I have uses the new version, and I need them to co-exist. one binary sync driver and one opensource drive,, running 2 sync cards, both feeding into the "framerealy" code. All the "perfect" methods are more work than this really requires sonce I'm pretty sure that a collision will not occur in the lifetime of this civilisation. > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message