This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Document GLIBC_PTHREAD_DEFAULT_STACKSIZE environmentvariable

On 03/01/2013 04:26 AM, Siddhesh Poyarekar wrote:
> 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.

Thanks, that sounds good. I've already done a review of that chapter,
and Roland's previous comments to your patch apply.

> [1]
> 	* 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.

`The stack size for all threads spawned by the program (except the main thread)
have their stack size set to the new default after adjusting 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.

`If the size is less than the minimum required POSIX stack size i.e.
 @code{PTHREAD_STACK_MIN}, then it is ignored and the minimum stack size is used.'

 is set to a value other than @code{RLIM_INFINITY}, then @code{RLIMIT_STACK} is
 used as the default thread stack size, otherwise an implementation dependent
 stack size is used.'

What do you think about that last paragraph which helps clarify some of the
defaults in the event the env-var is not set?

OK with that.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]