atom feed15 messages in org.freebsd.freebsd-threadsQuestion about our default pthread st...
FromSent OnAttachments
Alexander NedotsukovNov 18, 2004 11:54 pm 
Daniel EischenNov 19, 2004 8:01 am 
Joe Marcus ClarkeNov 19, 2004 9:52 am 
Daniel EischenNov 19, 2004 10:09 am 
Joe Marcus ClarkeNov 19, 2004 10:16 am 
Daniel EischenNov 19, 2004 11:53 am 
mez...@cox.netNov 19, 2004 1:21 pm 
Joe Marcus ClarkeNov 19, 2004 2:07 pm 
Niall DouglasNov 20, 2004 2:10 am 
Alexander NedotsukovNov 22, 2004 5:48 am 
Daniel EischenNov 22, 2004 6:14 am 
Joe Marcus ClarkeNov 22, 2004 6:28 am 
Alexander NedotsukovNov 22, 2004 8:30 am 
Craig RodriguesNov 26, 2004 10:56 am 
Alexander NedotsukovNov 29, 2004 12:11 am 
Subject:Question about our default pthread stack size
From:Alexander Nedotsukov (bla@FreeBSD.org)
Date:Nov 29, 2004 12:11:46 am
List:org.freebsd.freebsd-threads

Craig Rodrigues wrote:

On Mon, Nov 22, 2004 at 05:30:29PM +0900, Alexander Nedotsukov wrote:

- main stream follows the stack usage rules I described above and chosen 1MB/2MB for their default stacks size. - we have limit which most likely triggers SIGSEGV.

Alexander, what was the original application which you were working with where you encountered this thread stack problem?

This time it was libburn which did on stack reservation for its data structures which just exeeds 64K. Another sample could be gstreamer which is much more stack hungry.

It would be good if multithreaded code that was written on Linux or Solaris worked as much as possible "out of the box", especially large applications like GNOME. Like it or not, these are dominant platforms, and we might have to adjust a bit to accomodate their quirks of large default thread stack size (a developer can always decrease the stack size with pthread_attr_setstacksize() if his application requires a smaller stack).

What is the patch that would be required to increase the default stacksize in libpthread, so that mainstream applicatons like GNOME, or the application you were working with, would "just work"?

Is it something like:

Yep. It is. If this going to be commited please bump __FreeBSD_version so we'll be able to conditionaly remove current hacks.

Thanks, Alexander.

--- /tmp/thr_private.h.orig Fri Nov 26 13:50:16 2004 +++ /tmp/thr_private.h Fri Nov 26 13:50:55 2004 @@ -450,14 +450,14 @@ /* * Miscellaneous definitions. */ -#define THR_STACK_DEFAULT 65536 +#define THR_STACK_DEFAULT 0x100000

/* * Maximum size of initial thread's stack. This perhaps deserves to be larger * than the stacks of other threads, since many applications are likely to run * almost entirely on this stack. */ -#define THR_STACK_INITIAL 0x100000 +#define THR_STACK_INITIAL 0x200000

/* * Define the different priority ranges. All applications have thread