Hello, another patch for pthread_create.3, choose whichever you see more fit. I am trying to fix a FIXME in the pthread_create.3 manpage. It says info about default thread stack size should be put in pthread_attr_setstacksize.3 . And pthread_attr_setstacksize.3 says "For details on the default stack size of new threads, see pthread_create(3)". So I list the default values for several architectures, starting from glibc 2.12 (and still valid on current git glibc). The patch is attached (not inline, bacause I am a bit worried about TAB characters). Regards, Frederic Brault
From 550d8be0047a333608b4185f828f19fb6b1453a5 Mon Sep 17 00:00:00 2001 From: Frederic Brault <fbrault@xxxxxxxxxx> Date: Mon, 12 Mar 2018 13:55:55 +0100 Subject: [PATCH] Detailed list of thread default stack size per architecture --- man3/pthread_create.3 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/man3/pthread_create.3 b/man3/pthread_create.3 index 2bfe58b..e063ad8 100644 --- a/man3/pthread_create.3 +++ b/man3/pthread_create.3 @@ -198,9 +198,6 @@ By default, a new thread is created in a joinable state, unless was set to create the thread in a detached state (using .BR pthread_attr_setdetachstate (3)). .PP -.\" FIXME . Perhaps some of the following detail should be in -.\" a future pthread_attr_setstacksize(3) page. -On Linux/x86-32, the default stack size for a new thread is 2 megabytes. Under the NPTL threading implementation, if the .BR RLIMIT_STACK soft resource limit @@ -213,6 +210,23 @@ the stack size attribute can be explicitly set in the .I attr argument used to create a thread, in order to obtain a stack size other than the default. +If the +.BR RLIMIT_STACK +is set to "unlimited", a per-architecture value is used for stack size. For glibc 2.12 and up : +.TS +allbox; +lb lb +l r. +Architecture Default stack size +Sparc-32 2 MB +Sparc-64 4 MB +PowerPC 4 MB +S/390 2 MB +IA-64 32 MB +i386 2 MB +x86_64 2 MB +.TE + .SH BUGS In the obsolete LinuxThreads implementation, each of the threads in a process has a different process ID. -- 2.3.3