Date: Tue, 9 Oct 2001 15:57:30 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: Alfred Perlstein <bright@mu.org> Cc: John Baldwin <jhb@FreeBSD.org>, arch@FreeBSD.org Subject: Re: ucred API Message-ID: <Pine.BSF.4.21.0110091556210.27416-100000@InterJet.elischer.org> In-Reply-To: <20011009155703.A59854@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <julian@elischer.org> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0110091556210.27416-100000>