This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: allow LinuxThreads to have larger stacksfor the mainthread
- From: Kaz Kylheku <kaz at ashi dot footprints dot net>
- To: Wolfram Gloger <wmglo at dent dot med dot uni-muenchen dot de>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 26 Jun 2003 11:40:14 -0700 (PDT)
- Subject: Re: allow LinuxThreads to have larger stacksfor the mainthread
On 26 Jun 2003, Wolfram Gloger wrote:
> > This is not usable. Many architectures severely limit the stack size.
> > On x86 there is a hard limit of 8MB. The remaining 120MB would be
> > unused, or worse, used for other mappings.
>
> Ok, can someone explain to me that hard limit of 8MB on x86? I wasn't
> aware of it at all. Is this built into LinuxThreads in some other
> place, or is it a kernel limitation?
It's a default value in the kernel determined by compile-time constant.
You can raise the stack size for a process and its chilren.
Of course LinuxThreads manages its own stacks for threads which are
even smaller; this is the normal process stack we are talking about
that the kernel sets up.
To get thread stacks larger than 2 megs, you can allocate your own
stacks and set them up at thread creation time via the attribute
mechanism.