Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Jan 2002 12:48:16 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        Alfred Perlstein <bright@mu.org>, arch@freebsd.org
Subject:   Re: freeing thread structures.
Message-ID:  <3C376690.6B14328@mindspring.com>
References:  <Pine.BSF.4.21.0201051100540.34014-100000@InterJet.elischer.org>

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

-- Terry

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?3C376690.6B14328>