Pthread stack issues

Pthread stack issues

What is the relationship with the shell stack limit (ulimit -s ) and the stack size for threads chosen by the user with pthread_attr_setstacksize? Can the stack size for a created thread be made larger than the stack size for the parent thread? Are there any limits or defaults that users should be aware of?

I've been told that the ulimit needs to be a numerical value to be able to set a created thread's stack size to some larger number. If the ulimit is set to 'unlimited', then there is a default limit (16 MB?) on a thread's stacksize. And all of this only applies to RedHat 7.2 and beyond.

Can anyone confirm or correct this information? If I'm not running RedHat Linux, is there a particular kernel version that has support for thread stacks being different sizes (bigger) that parent stacks?

Thanks.

-- clay

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

> What is the relationship with the shell stack limit
> (ulimit -s ) and the stack size for
> threads chosen by the user with
> pthread_attr_setstacksize? ...

http://groups.google.com/groups?selm=aYrE8.7%24hU2.243848%40cacnews.cac....

Uhmm, and perhaps: ("dynamic stack segment model")

http://groups.google.com/groups?selm=3D53D60E.6EF3AA31%40web.de

regards,
alexander.

Alexander, thanks for the pointers. Do you (or anyone) have any specific information on Linux and Linuxthreads stacks? While Butenhof mentions that the (POSIX) standard says nothing about the relationship of thread stacks to the process limit (and he and the original poster mention Tru64 and Solaris limits), someone somewhere must have made a conscious decision to set something.

Thanks.

-- clay

> Alexander, thanks for the pointers. Do you (or
> anyone) have any specific information on Linux and
> Linuxthreads stacks?

Linuxthreads is history. Try asking it here:

http://listman.redhat.com/mailman/listinfo/phil-list

regards,
alexander.

P.S. Do a search on "__default_stacksize" in the NPTL sources...

--
http://sources.redhat.com/ml/libc-alpha/2002-03/msg00141.html

Leave a Comment

Please sign in to add a comment. Not a member? Join today