|
|
HP-UX Reference > Ppthread_default_rsestacksize_np(3T)Pthread LibraryHP-UX 11i Version 2: December 2007 Update |
|
NAMEpthread_default_rsestacksize_np() — change the default stacksize. SYNOPSIS#include <pthread.h> int pthread_default_rsestacksize_np( size_t new_size, size_t *old_size ); PARAMETERS
DESCRIPTIONThe pthread_default_rsestacksize_np() function allows an application to change the default value for the rsestacksize attribute. This function must be called before any threads have been created. The new default stack size is passed in the new_size parameter. If not NULL, the previous default stack size is returned in old_size. If new_size is zero, this function can be used (at any time) to query the current default stack size. On HP-UX, threads with default stack sizes are cached after they terminate. The next time a thread is created with a default stack size, a cached thread (and its stack) are reused. This can result in significant performance improvements for pthread_create(). However, if the default register stack size is not appropriate for an application, it cannot take advantage of this performance enhancement. By using the pthread_default_rsestacksize_np() function, the threads library will change the default stack size so that it matches the applications needs. This allows the application to utilize the performance benefit of cached threads. If either of the set register stack size APIs is called (pthread_default_rsestacksize_np(), pthread_attr_setrsestacksize()) the register stack portion of the stack space will be that large instead of size determined by the implementation. The memory stack portion will be the remainder. RETURN VALUEUpon successful completion, pthread_default_rsestacksize_np() returns zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set). ERRORSIf any of the following occur, the pthread_default_rsestacksize_np() function returns the corresponding error number:
SEE ALSOpthread_attr_getstacksize(3T), pthread_attr_setstacksize(3T), pthread_default_stacksize_np(3T). |
|