From owner-freebsd-threads@FreeBSD.ORG Mon Jan 24 23:15:59 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 69A9416A4CE; Mon, 24 Jan 2005 23:15:59 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4270043D1F; Mon, 24 Jan 2005 23:15:59 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 1DF1D7A403; Mon, 24 Jan 2005 15:15:59 -0800 (PST) Message-ID: <41F581AE.2050603@elischer.org> Date: Mon, 24 Jan 2005 15:15:58 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Joe Marcus Clarke References: <1106595434.28710.29.camel@shumai.marcuscom.com> In-Reply-To: <1106595434.28710.29.camel@shumai.marcuscom.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Daniel Eischen cc: threads@freebsd.org Subject: Re: [PATCH] Dynamic thread stack size X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2005 23:15:59 -0000 Joe Marcus Clarke wrote: >On Mon, 2005-01-24 at 14:31 -0500, Daniel Eischen wrote: > > >>On Mon, 24 Jan 2005, Joe Marcus Clarke wrote: >> >> >> >>>On Sat, 2005-01-22 at 13:03 -0500, Daniel Eischen wrote: >>> >>> >>>>On Fri, 21 Jan 2005, Joe Marcus Clarke wrote: >>>> >>>> >>>> >>>>>In a follow-up to the previous discussion on increasing our default >>>>>thread stacksize, I thought I'd look at how some other BSD >>>>>implementations do it. Mezz mentioned that he thought NetBSD had a 2 MB >>>>>default stacksize, so I took a look. >>>>> >>>>>What I found was that NetBSD doesn't have a static default stacksize. >>>>>Instead, they use the stacksize rlimit and a PTHREAD_STACKSIZE >>>>>environment variable to get both the initial stacksize as well as each >>>>>thread's default stacksize. I thought this would be a really good way >>>>>of doing things, so I ported their work to FreeBSD. >>>>> >>>>> >>>>Please no. I don't want to have to set any more environment >>>>variables or login defaults to get libpthread to work with >>>>certain ports. >>>> >>>> >>>No need. The default stacksize rlimit is more than enough (64 MB) to >>>satisfy every one of the affected ports thus far. The environment >>> >>> >>And 64MB is way too big for a default stack size... >> >> > >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. > >Joe > > >