Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2002 14:55:35 -0600
From:      Alfred Perlstein <bright@mu.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        arch@freebsd.org
Subject:   Re: freeing thread structures.
Message-ID:  <20020105145534.Y82406@elvis.mu.org>
In-Reply-To: <3C376690.6B14328@mindspring.com>; from tlambert2@mindspring.com on Sat, Jan 05, 2002 at 12:48:16PM -0800
References:  <Pine.BSF.4.21.0201051100540.34014-100000@InterJet.elischer.org> <3C376690.6B14328@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Terry Lambert <tlambert2@mindspring.com> [020105 14:48] wrote:
> Julian Elischer wrote:
> > Yes but there must be a good synchronous way of doing this..
> > An async method will always lead to a lag in teh number of threads
> > actually available, as it will.... hmmmm
> > 
> > I was going to say that the availability of threads will be
> > limited because there will e actually free threads that have not yet been
> > properly freed, by which I mean that they have not had their ucred's
> > crfree()'d yet etc. However it just occurs to me that
> > maybe if we ran short of threads, we are probably in a situation to
> > free them and make them available to ourselves..
> 
> Uh, if the problem is creds, under what circumstances in POSIX
> is it permissable to have multiple threads in a process with
> different credentials?
> 
> In other words, aren't you asking the wrong question here?  I
> think the question is not "how can I free creds in thread_exit?",
> it's "why am I storing creds per thread in the first place?".
> 
> > The ready-to-free thread structureas don't have anything except for
> > the ucred in them that really requires freeing before they are put into
> > the thread cache. so it's not a lot of waste to let them gather up a
> > bit... (They'd just be in the cache anyhow, unless it was full
> > in which case the stackpages would be dissociated and freed)
> 
> Yes, exactly.  And referencing the cred via the thread doesn't
> make sense anyway (IMO)...

Well...

Actually I always thought it was suboptimal the way one had
to setuid back and forth when running as another user, if one could
"setthreaduid()" it would allow somewhat effecient multiplexing
of sperate credentials through an authentication server.

This of ftpd without needing to fork() to handle non-anonymous
connections.

I'm sure there's an even smarter way, but it's just something that
that I thought might be cool.

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/

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?20020105145534.Y82406>