This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Document GLIBC_PTHREAD_DEFAULT_STACKSIZE environment variable
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, libc-alpha at sourceware dot org
- Date: Fri, 1 Mar 2013 14:56:15 +0530
- Subject: [PATCH] Document GLIBC_PTHREAD_DEFAULT_STACKSIZE environment variable
- References: <20130115100110.GL7894@spoyarek.pnq.redhat.com><20130117000752.EFE8D2C0BC@topped-with-meat.com><20130205130832.GG19791@spoyarek.pnq.redhat.com><51301FB2.2020706@redhat.com>
Hi,
This patch adds documentation for GLIBC_PTHREAD_DEFAULT_STACKSIZE in
the glibc manual. It assumes that the nptl chapter has been created
by my earlier thread_local manual patch[1], so that will need to go in
before this one.
Siddhesh
[1] http://sourceware.org/ml/libc-alpha/2013-02/msg00446.html
* manual/nptl.texi (POSIX Threads): New node on Non-POSIX
Extensions.
diff --git a/manual/nptl.texi b/manual/nptl.texi
index c727870..150c23c 100644
--- a/manual/nptl.texi
+++ b/manual/nptl.texi
@@ -9,6 +9,8 @@ This chapter describes the @glibcadj{} POSIX Thread implementation.
@menu
* Thread-specific Data:: Support for creating and
managing thread-specific data
+* Non-POSIX Extensions:: Additional functions to extend
+ POSIX Thread functionality
@end menu
@node Thread-specific Data
@@ -44,3 +46,29 @@ Set @var{value} as the thread-specific data to be referred by @var{key} in the
calling thread.
@end table
+
+@node Non-POSIX Extensions
+@section Non-POSIX Extensions
+
+In addition to implementing the POSIX API for threads, @theglibc{} provides
+additional functions and interfaces to provide functionality not specified in
+the standard.
+
+@menu
+* Thread Stack Size:: Setting default stack size
+@end menu
+
+@node Thread Stack Size
+@subsection Setting Process-wide defaults for thread stack size
+
+The POSIX Thread implementation in @theglibc{} allows a developer to specify
+the stack size for threads it creates by creating an @code{pthread_attr_t}
+type with the stack size defined and then using that for each pthread_create
+call. There is however no way in the standard to do this at an administrative
+level either by using a configuration file or an environment variable. In
+@theglibc{} this is possible by exporting an environment variable
+@code{GLIBC_PTHREAD_DEFAULT_STACKSIZE} in the environment of the process.
+The stack size all threads spawned by the program (except the main thread) to
+have this size, adjusted upwards for internal data structures and alignment.
+If the size is less than @code{PTHREAD_STACK_MIN}, then it is ignored and the
+minimum stack size is used.