Date: Mon, 24 Jan 2005 19:34:39 -0500 From: Joe Marcus Clarke <marcus@FreeBSD.org> To: Daniel Eischen <deischen@FreeBSD.org> Cc: Julian Elischer <julian@elischer.org> Subject: Re: [PATCH] Dynamic thread stack size Message-ID: <1106613279.28710.63.camel@shumai.marcuscom.com> In-Reply-To: <Pine.GSO.4.43.0501241914500.19951-100000@sea.ntplx.net> References: <Pine.GSO.4.43.0501241914500.19951-100000@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-3UCwqG9roVlPB2r+giyU Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2005-01-24 at 19:24 -0500, Daniel Eischen wrote: > On Mon, 24 Jan 2005, Joe Marcus Clarke wrote: >=20 > > On Mon, 2005-01-24 at 15:15 -0800, Julian Elischer wrote: > > > > > > >> > > > > > > > >Okay, so lobby that it gets reduced in login.conf. Why should threa= ds > > > >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 re= source. > > > > 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? >=20 > KSE !=3D thread >=20 > 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. Ah, okay, I suspected that was the case for libc_r, but I wasn't sure if the same thing held for all threading libraries. What about increasing the default stack sizes as you've said you wanted to do, plus leaving in the environment variable to aid in transition should the stack size have to be bumped again in the future? This would also give us an easy way to test for stack overflows without instructing users to rebuild their threading library. Also, what were your planned stacksize increments? I was hoping for something along the lines of: INITIAL (32-bit): 2 MB INITIAL (64-bit) 4 MB DEFAULT (32-bit): 1 MB DEFAULT (64-bit): 2 MB Joe >=20 --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-3UCwqG9roVlPB2r+giyU 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) iD8DBQBB9ZQfb2iPiv4Uz4cRAjzxAKCBMXGXM7D5rUwDEnAumpxkZxOD3ACfVced AtGeXhJc6I1biv5TcZBINIE= =UKcx -----END PGP SIGNATURE----- --=-3UCwqG9roVlPB2r+giyU--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1106613279.28710.63.camel>