Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2001 15:57:03 -0500
From:      Alfred Perlstein <bright@mu.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        John Baldwin <jhb@FreeBSD.org>, arch@FreeBSD.org
Subject:   Re: ucred API
Message-ID:  <20011009155703.A59854@elvis.mu.org>
In-Reply-To: <Pine.BSF.4.21.0110091416500.27416-100000@InterJet.elischer.org>; from julian@elischer.org on Tue, Oct 09, 2001 at 02:33:06PM -0700
References:  <20011009150339.X59854@elvis.mu.org> <Pine.BSF.4.21.0110091416500.27416-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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?20011009155703.A59854>