From owner-freebsd-arch Mon Nov 12 15: 8:57 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 1B11A37B416 for ; Mon, 12 Nov 2001 15:08:53 -0800 (PST) Received: (qmail 39315 invoked from network); 12 Nov 2001 23:08:43 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 Nov 2001 23:08:43 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200111122254.fACMsNd06845@apollo.backplane.com> Date: Mon, 12 Nov 2001 15:08:37 -0800 (PST) From: John Baldwin To: Matthew Dillon Subject: Re: cur{thread/proc}, or not. Cc: freebsd-arch@FreeBSD.ORG, Robert Watson , Terry Lambert 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 12-Nov-01 Matthew Dillon wrote: >:The point is that if the credentials are granted, then a >:change in credential is not a change of the credential itself, >:but is instead a copy-on-write proposition. In other words, >:credentials, once granted, are priviledge stable. >: >:If this is the case, then they are written when they are >:instanced, cloned before they are modified (indeed, it seems >:that the clone/modify operation must be made atomic), and >:thus are never written once instanced -- only destroyed on >:the 1->0 reference transition. >: >:If so, then no locking is required, since the LCK CMPXCHG can >:be utilized to do atomic increment and decrement on the >:reference counting, without needing locks. >:... >: >:-- Terry > > Yes, I believe this is how credentials work. I looked at > the code about 6 months ago. We should not have to do any > locking of the credential stuff, only simple mutexing > around the ref counter. That is how it should work > is how I believe it currently works. Yep. They use a mutex for the refcount for now, but I still have patches that some people don't like for implementing a simple refcount API just using atomic operations. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message