From owner-cvs-all@FreeBSD.ORG Wed Jun 9 18:07:27 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B8A316A4D1; Wed, 9 Jun 2004 18:07:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 718A943D41; Wed, 9 Jun 2004 18:07:27 +0000 (GMT) (envelope-from bmilekic@FreeBSD.org) Received: from freefall.freebsd.org (bmilekic@localhost [127.0.0.1]) i59I6hhP037136; Wed, 9 Jun 2004 18:06:43 GMT (envelope-from bmilekic@freefall.freebsd.org) Received: (from bmilekic@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i59I6h6j037135; Wed, 9 Jun 2004 18:06:43 GMT (envelope-from bmilekic) Date: Wed, 9 Jun 2004 18:06:42 +0000 From: Bosko Milekic To: Julian Elischer Message-ID: <20040609180642.GA33304@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i cc: src-committers@FreeBSD.org cc: Pawel Jakub Dawidek cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: phk@phk.freebsd.dk cc: Nate Lawson cc: "M. Warner Losh" Subject: Re: cvs commit: src/sys/kern kern_proc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2004 18:07:27 -0000 Julian Elischer wrote: >As I've said before and will continue to say.. >"We need a more formal model of dealing with reference counts" > >i.e. > >we should get a set of reference counting primatives and make it WELL >DOCUMENTED as to how they should be used.. > >Referenc counting is something that you can't do "a bit". It's like >being pregnant.. either you ARE reference counting, or you are doing >something else. You can't count just "SOME" of the references.. While this idea is initially appealing, you should be aware that it is not as straight-forward as it sounds. Namely, it is sometimes more advantageous to protect the manipulation of the reference count within a section of code already protected by an appropriate object mutex, and other times (in the absence of a mutex), it might be more advantageous to use atomic ops (no need for a mutex, slightly less costly per-instance). So defining an API that does one OR the other might not always be appropriate. -Bosko