From owner-freebsd-threads@FreeBSD.ORG Tue Jan 25 00:24:24 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F98116A4CE; Tue, 25 Jan 2005 00:24:24 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7F4D43D2F; Tue, 25 Jan 2005 00:24:23 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) j0P0OCgm029982; Mon, 24 Jan 2005 19:24:12 -0500 (EST) Date: Mon, 24 Jan 2005 19:24:04 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Joe Marcus Clarke In-Reply-To: <1106611680.28710.48.camel@shumai.marcuscom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: threads@freebsd.org cc: Julian Elischer Subject: Re: [PATCH] Dynamic thread stack size X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 00:24:24 -0000 On Mon, 24 Jan 2005, Joe Marcus Clarke wrote: > On Mon, 2005-01-24 at 15:15 -0800, Julian Elischer wrote: > > > > >> > > > > > >Okay, so lobby that it gets reduced in login.conf. Why should threads > > >be given less stack than processes, especially the initial thread? > > > > > > > because there may be 50 of them? (or maybe even 500?) > > > > Threaded programs are supposed to be aware that stack is a limited resource. > > I thought about that, but I also thought that KSEs were treated > similarly to processes so it wouldn't matter if each one had a full > allocation of stacksize? KSE != thread A (userland) KSE stack is very small and is just enough to schedule threads. A thread stack is allocated (by default) off the one (and only one) process' stack. Allocating lots of threads with large stacks depletes the process stack. -- DE