From owner-freebsd-arch Sat Jan 5 12:48:55 2002 Delivered-To: freebsd-arch@freebsd.org Received: from snipe.prod.itd.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id F366037B432 for ; Sat, 5 Jan 2002 12:48:32 -0800 (PST) Received: from pool0211.cvx21-bradley.dialup.earthlink.net ([209.179.192.211] helo=mindspring.com) by snipe.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Mxjt-00013A-00; Sat, 05 Jan 2002 12:48:25 -0800 Message-ID: <3C376690.6B14328@mindspring.com> Date: Sat, 05 Jan 2002 12:48:16 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Julian Elischer Cc: Alfred Perlstein , arch@freebsd.org Subject: Re: freeing thread structures. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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