First - this is a glibc issue, not a kernel issue, I bet.
Second - the new behavior seems allowed by the standard, if not desirable.
Portably speaking, the default stack size for a thread may be quite large.
If you want to consume less memory, either configure the threads to use a
smaller stack with pthread_attr_setstacksize() (I haven't tried this),
or use fewer threads (my favorite approach).
Third - the old behavior is hinted by
http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html
(see below) so perhaps there's a problem with newer glibc's?
- Dan
"E.5: Does LinuxThreads implement pthread_attr_setstacksize() and pthread_attr_setstackaddr()?
These optional functions are provided in recent versions
of LinuxThreads (0.8 and up). Earlier releases did not provide
these optional components of the POSIX standard.
Even if pthread_attr_setstacksize() and pthread_attr_setstackaddr()
are now provided, we still recommend that you do not use them
unless you really have strong reasons for doing so. The default
stack allocation strategy for LinuxThreads is nearly optimal:
stacks start small (4k) and automatically grow on demand to a
fairly large limit (2M).
Moreover, there is no portable way to estimate the stack requirements
of a thread, so setting the stack size yourself makes your program
less reliable and non-portable."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/