From owner-freebsd-arch Tue Oct 9 13:57: 6 2001 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 6E62937B40A; Tue, 9 Oct 2001 13:57:03 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id 7792681D01; Tue, 9 Oct 2001 15:57:03 -0500 (CDT) Date: Tue, 9 Oct 2001 15:57:03 -0500 From: Alfred Perlstein To: Julian Elischer Cc: John Baldwin , arch@FreeBSD.org Subject: Re: ucred API Message-ID: <20011009155703.A59854@elvis.mu.org> References: <20011009150339.X59854@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from julian@elischer.org on Tue, Oct 09, 2001 at 02:33:06PM -0700 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 Tue, 9 Oct 2001, Alfred Perlstein wrote: > > You only need to reference the cred when a thread is created. > > > > In terms of KSE, what I think that means when you'd block leaving a > > context (lazy thread creation) you'd do your dup. * Julian Elischer [011009 15:30] wrote: > errr, Alfred.. > > The kernel "thread" structure is only valid when the user thread > "dips" into the kernel.. The more threads "dip" into the kernel > (e.g. do syscalls,) the more kernel threads are created to run on their > behalf. Thus strictly speaking kernel thread structures only last for the > lifetime of a syscall. (in practice they are cached but theoretically > they are freed and reallocated). > > Since there may be many syscalls outstanding, each works with the creds > that existed at the moment when it was invoked. So it's really keyed at thread creation time (as I stated), not at syscall time, don't forget that you may have multiple threads executing in userland to achieve SMP scalability. The importance of this is that there's one per thread, not one per syscall even though that may be an N-N relationship. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message