From owner-freebsd-arch Tue Oct 9 14:50:55 2001 Delivered-To: freebsd-arch@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id BE39837B411; Tue, 9 Oct 2001 14:50:52 -0700 (PDT) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA28437; Tue, 9 Oct 2001 15:57:31 -0700 (PDT) Date: Tue, 9 Oct 2001 15:57:30 -0700 (PDT) From: Julian Elischer To: Alfred Perlstein Cc: John Baldwin , arch@FreeBSD.org Subject: Re: ucred API In-Reply-To: <20011009155703.A59854@elvis.mu.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 it's one per syscall. because the thread structure may be allocated to another process should it require it immediatly after the current syscall finishes. On Tue, 9 Oct 2001, Alfred Perlstein wrote: > > 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