From owner-freebsd-threads@FreeBSD.ORG Tue Jan 25 00:08:26 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 1139916A4CE; Tue, 25 Jan 2005 00:08:26 +0000 (GMT) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C59B43D54; Tue, 25 Jan 2005 00:08:25 +0000 (GMT) (envelope-from marcus@FreeBSD.org) Received: from shumai.marcuscom.com (shumai.marcuscom.com [192.168.1.4]) j0P08gED052965; Mon, 24 Jan 2005 19:08:42 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Julian Elischer In-Reply-To: <41F581AE.2050603@elischer.org> References: <1106595434.28710.29.camel@shumai.marcuscom.com> <41F581AE.2050603@elischer.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ozTg/t36weCHACpytyss" Organization: FreeBSD, Inc. Date: Mon, 24 Jan 2005 19:08:00 -0500 Message-Id: <1106611680.28710.48.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 FreeBSD GNOME Team Port 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: Tue, 25 Jan 2005 00:08:26 -0000 --=-ozTg/t36weCHACpytyss Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2005-01-24 at 15:15 -0800, Julian Elischer wrote: >=20 > Joe Marcus Clarke wrote: >=20 > >On Mon, 2005-01-24 at 14:31 -0500, Daniel Eischen wrote: > > =20 > > > >>On Mon, 24 Jan 2005, Joe Marcus Clarke wrote: > >> > >> =20 > >> > >>>On Sat, 2005-01-22 at 13:03 -0500, Daniel Eischen wrote: > >>> =20 > >>> > >>>>On Fri, 21 Jan 2005, Joe Marcus Clarke wrote: > >>>> > >>>> =20 > >>>> > >>>>>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 ea= ch > >>>>>thread's default stacksize. I thought this would be a really good w= ay > >>>>>of doing things, so I ported their work to FreeBSD. > >>>>> =20 > >>>>> > >>>>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. > >>>> =20 > >>>> > >>>No need. The default stacksize rlimit is more than enough (64 MB) to > >>>satisfy every one of the affected ports thus far. The environment > >>> =20 > >>> > >>And 64MB is way too big for a default stack size... > >> =20 > >> > > > >Okay, so lobby that it gets reduced in login.conf. Why should threads > >be given less stack than processes, especially the initial thread? > > >=20 > because there may be 50 of them? (or maybe even 500?) >=20 > Threaded programs are supposed to be aware that stack is a limited resour= ce. 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? Joe >=20 >=20 > > > >Joe > > > > =20 > > >=20 >=20 --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-ozTg/t36weCHACpytyss Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQBB9Y3gb2iPiv4Uz4cRAsWQAKCpnxe0tuzAdwxtt5fCw+WawV5QlgCfZfJL 6SYfNDUD+3vCTuAYgHofmNY= =CQcJ -----END PGP SIGNATURE----- --=-ozTg/t36weCHACpytyss--