Question about our default pthread stack size

Daniel Eischen deischen at freebsd.org
Fri Nov 19 10:09:35 PST 2004


On Fri, 19 Nov 2004, Joe Marcus Clarke wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Daniel Eischen wrote:
> | On Fri, 19 Nov 2004, Alexander Nedotsukov wrote:
> |
> |
> |>Hey guys,
> |>
> |>After squashing yet another "too small thread stack size" bug in
> |>software developed on Linux. I decided to ask gurus for the comment. Why
> |>we still insist that 64K is good enough for 32bit archs? I do understand
> |
> |
> | I suggested we double the stack size for 64-bit archs (making it
> | 128K).  I could see going to 256K for 32-bit and 512K for 64-bit.
>
> ia64 already uses a 256 KB default stack size.  However, I argue that is
> is "too small."  Linux has a much higher default (inline with the
> document bland referenced), and thus, most popular multithreaded
> applications are developed with that in mind.
>
> It has become some problematic for GNOME, for example, that I have
> hacked glib20 to allocate a default 1 MB stack on all architectures
> (this is, of course, configurable).

The thing I worry about is these piggy applications being the
driving force behind our stack size.  If they really are designed
to need a huge stack size, they should be the ones that change
to support it, not the other way around.  Do they know their own
stack space requirements or do they just ignore it because it
isn't a problem so far (on Linux)?  What if they need more than
1MB in a few months (Bill Gates -- who's ever going to need
more than 64K ;-)?  Are we going to change again?

I can see raising the default stack size, but 1MB (32-bit) and
2MB (64-bit) seem kinda large.

-- 
DE



More information about the freebsd-threads mailing list