HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
p
pthread_attr(3T) pthread_attr(3T)
(Pthread Library)
with this attribute to reclaim the system resources.
The default value of detachstate is PTHREAD_CREATE_JOINABLE.
pthread_attr_setdetachstate() is used to set the detachstate attribute in the initialized attri-
butes object attr. The new value of the detachstate attribute is passed to this function in the detachstate
parameter.
pthread_attr_getdetachstate() retrieves the value of the detachstate attribute from the thread
attributes object attr. This value is returned in the detachstate parameter.
ATTRIBUTE: stacksize
The legal values for the stacksize attribute are:
PTHREAD_STACK_MIN
This option specifies that the size of the user stack for threads created with this attributes object
will be of default stack size. This value is the minimum stack size (in bytes) required for a
thread. This minimum value may not be acceptable for all threads.
stacksize
This defines the size (in bytes) of the user stack for threads created with this attributes object.
This value must be greater than or equal to the minimum stack size
PTHREAD_STACK_MIN
.
POSIX.1c does not define a default value. On HP-UX Release 10.30, the default value of the stacksize attri-
bute is 64K.
pthread_attr_setstacksize()
is used to set the stacksize attribute in the initialized attributes
object attr. The new value of the stacksize attribute is passed to this function in the stacksize parameter.
pthread_attr_getstacksize()
retrieves the value of the stacksize attribute from the thread attri-
butes object attr. This value is returned in the stacksize parameter.
ATTRIBUTE: stackaddr
The legal values for the stackaddr attribute are:
NULL
This option specifies that the storage for the user stack of any threads created with this attri-
butes object will be allocated and deallocated by the threads library. The application does not
need to allocate and manage thread stacks.
stack_address
This option specifies the base address of a stack that the created thread will use. The application
is completely responsible for allocating, managing, and deallocating these stacks. Some options
for allocation of storage are the malloc(3C), brk(2), and mmap(2) functions. Note: if this option
is used, only one thread should be created with this attributes object. If multiple threads are
created, they will all use the same stack.
The default value of the stackaddr attribute is NULL.
pthread_attr_setstackaddr() is used to set the stackaddr attribute in the initialized attributes
object attr. The new value of the stackaddr attribute is passed to this function in the stackaddr parameter.
pthread_attr_getstackaddr() retrieves the value of the stackaddr attribute from the thread
attributes object attr. This value is returned in the stackaddr parameter.
The guardsize attribute is ignored if the storage for the thread’s user stack is not allocated by the library
(i.e., the stackaddr attribute is not NULL).
ATTRIBUTE: guardsize
The guardsize attribute allows an application to specify the size of the guard area for threads created with
this attributes object. The size of the guard area is specified in bytes. Most systems will round up the
guard size to a multiple of the system configurable variable PAGESIZE. If the value zero is specified, a
guard area will not be created.
The default value of guardsize is PAGESIZE bytes. The actual value of PAGESIZE is implementation-
dependent and may not be the same on all implementations. The guardsize attribute is ignored if the
storage for the user stack is not allocated by the pthread library. The application is responsible for protect-
ing against stack overflow.
pthread_attr_setguardsize()
is used to set the guardsize attribute in the initialized attributes
object attr. The new value of the guardsize attribute is passed to this function in the guardsize parameter.
Section 3648 3 HP-UX Release 11i: December 2000
___
___