System-Managed Stack Attributes
POSIX 1003.1c-compliant systems provide optional support for controlling the reserve size of a system-managed stack, but provide no support for controlling the commitment of physical memory and page-file space to a thread stack.
Stack Reserve Size. In POSIX 1003.1c-compliant systems, support for user specification of stack reserve size is optional. The Threads Module determines the support for stack reserve size by testing for the definition of the standard POSIX macro
_POSIX_THREAD_ATTR_STACKSIZE.
The HP POSIX implementation does support the stack reserve size attribute for a system-managed stack.
If available, the Threads Module uses the following function call, sysconf(_SC_THREAD_STACK_MIN), as defined in <unistd.h>, to determine recommended minimum size for a thread stack. Otherwise, the Threads Module uses the POSIX macro, PTHREAD_STACK_MIN, to determine the recommended minimum size for a user thread stack. HP POSIX defines this value to be 4KB (the amount of stack space required to start a thread with an null function). This is the value that will be returned by the getMinStackSize() member.
If you query for the default stack reserve size, the Threads Module uses the pthread_attr_getstacksize() function to retrieve the default stack size defined by an initialized pthread_attr_t instance. Under HP-UX POSIX, the default stack size is 256KB on IA64.
The Threads Module imposes no upper limit for stack reserve size; the maximum stack size is effectively limited by available virtual memory space and page-file size. If the stack reserve size specified is too large for the available resources, an exception will be produced at the time a thread is created using the thread attribute instance with the offending reserve size value.
Stack Commit Size. The stack commit size attribute is not supported in the HP-UX POSIX implementation of the Threads Module. Attempts to get or set this attribute value will result in exceptions.