From owner-freebsd-arch Wed May 23 10:11:57 2001 Delivered-To: freebsd-arch@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 68FB537B422 for ; Wed, 23 May 2001 10:11:54 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id NAA30721; Wed, 23 May 2001 13:11:45 -0400 (EDT) (envelope-from wollman) Date: Wed, 23 May 2001 13:11:45 -0400 (EDT) From: Garrett Wollman Message-Id: <200105231711.NAA30721@khavrinen.lcs.mit.edu> To: Brian Somers Cc: freebsd-arch@FreeBSD.ORG Subject: Re: RFC: unit_list routines In-Reply-To: <200105231552.f4NFqwF05688@hak.lan.Awfulhak.org> References: <200105231523.LAA29635@khavrinen.lcs.mit.edu> <200105231552.f4NFqwF05688@hak.lan.Awfulhak.org> 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 < said: > The way I see it, holding and releasing mutexes will introduce > contention between consumers that only want to maintain a [completely > private] sparce array. I think the usual watchword is ``Don't optimize initialization.'' > Allocating a ``struct resource'' munges a completely separate > resource (allocated units) in with all of the existing resources I'm having a bit of difficulty understanding the point you're trying to make here. It's a general interface; you need a subset of that functionality. Your resource is not ``munged [...] in with all of the existing resources'' -- each resource is managed separately, through its rman structure. > of lists and backwards pointers to achieve something that means > nothing in the context of these allocated units. Those lists and backwards pointers are not there for the benefit of clients, and should be treated as opaque. Actually, the whole `struct resource' should be treated as opaque, although because accessors are provided as macros rather than functions it can't be made literally so. > Using bits when there are large numbers of units gets awkward. Just wrap it in macros. I almost posted an implementation with my last message, but decided that since it was so trivial it would be almost insulting for me to do so. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message