Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Pthread stack issues

ClayB
New Contributor I
840 Views
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
0 Kudos
3 Replies
Intel_C_Intel
Employee
840 Views
> 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.cpqcorp.net

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

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

regards,
alexander.
0 Kudos
ClayB
New Contributor I
840 Views
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
0 Kudos
Intel_C_Intel
Employee
840 Views
> 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
0 Kudos
Reply