From owner-freebsd-arch Sat Jan 5 12:55:45 2002 Delivered-To: freebsd-arch@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 8022C37B41A for ; Sat, 5 Jan 2002 12:55:40 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 0825881D01; Sat, 5 Jan 2002 14:55:35 -0600 (CST) Date: Sat, 5 Jan 2002 14:55:35 -0600 From: Alfred Perlstein To: Terry Lambert Cc: arch@freebsd.org Subject: Re: freeing thread structures. Message-ID: <20020105145534.Y82406@elvis.mu.org> References: <3C376690.6B14328@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C376690.6B14328@mindspring.com>; from tlambert2@mindspring.com on Sat, Jan 05, 2002 at 12:48:16PM -0800 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 * Terry Lambert [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