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

p
pthread_attr_getdetachstate(3T) pthread_attr_getdetachstate(3T)
(Pthread Library)
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 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.
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 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.
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.
PTHREAD_EXPLICIT_SCHED
This option specifies that the scheduling policy and associated attributes for the created thread(s)
are to be taken from this attributes object. These values will not be inherited from the creating
thread.
POSIX.1c does not define a default value for the inheritsched attribute. On HP-UX, the default value is
PTHREAD_INHERIT_SCHED.
pthread_attr_setinheritsched() is used to set the inheritsched attribute in the initialized attri-
butes object attr. The new value of the inheritsched attribute is passed in the inheritsched parameter.
HP-UX 11i Version 2: December 2007 Update 4 Hewlett-Packard Company 189