pthread_attr_getdetachstate.3t (2010 09)

p
pthread_attr_getdetachstate(3T) pthread_attr_getdetachstate(3T)
(Pthread Library)
ATTRIBUTE: rsestacksize
The legal values for the rsestacksize are:
rsestacksize
This defines the size (in bytes) of the register stack for the threads created with the attributes
object.
pthread_attr_setrsestacksize_np()
is used to set the register stack size for a thread and
pthread_default_rsestacksize_np()
to set the default register stack size. If either of the set
register stack size APIs is called, the register stack portion of the stack space will be that large instead of
implementation defined division. The memory stack portion will be the remainder.
pthread_attr_getrsestacksize_np()
retrieves the value of the rsestacksize attribute from the
thread attributes object attr . This value is returned in the rsestacksize 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
attributes 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 attri-
butes 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 parame-
ter. If the size of stack pointed to by stackaddr is different from the default stack size, the application
must call
pthread_attr_setstacksize()
to set the new stack size.
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 pro-
tecting 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 parame-
ter.
pthread_attr_getguardsize() retrieves the value of the guardsize attribute from the thread
attributes object attr . This value is returned in the guardsize parameter. If the guard area is rounded
up to a multiple of
PAGESIZE, a call to this function shall store in the guardsize parameter the guard
size specified in the previous pthread_attr_setguardsize() function call.
ATTRIBUTE: inheritsched
The legal values for the inheritsched attribute are:
PTHREAD_INHERIT_SCHED
This option specifies that the scheduling policy and associated attributes are to be inherited
from the creating thread. The scheduling policy and associated attributes in the attr argument
will be ignored when a thread is created with attr .
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010