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

p
pthread_attr_getdetachstate(3T) pthread_attr_getdetachstate(3T)
(Pthread Library)
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.
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.
pthread_attr_getinheritsched()
retrieves the value of the inheritsched attribute from the
thread attributes object attr . This value is returned in the inheritsched parameter.
ATTRIBUTE: schedpolicy
The schedpolicy attribute allows threads created with this attributes object to use a specific scheduling
policy. To use this attribute, the inheritsched attribute must be set to
PTHREAD_EXPLICIT_SCHED
.
For a complete list of valid scheduling policies, refer to rtsched (2) and
<sched.h>
.
POSIX.1c does not specify a default value for the schedpolicy attribute. On HP-UX, the default value for
system scope threads is
SCHED_TIMESHARE
.
pthread_attr_setschedpolicy()
is used to set the schedpolicy attribute in the initialized attri-
butes object attr. The new value of the schedpolicy attribute is passed to this function in the policy
parameter.
pthread_attr_getschedpolicy() retrieves the value of the schedpolicy attribute from the thread
attributes object attr . This value is returned in the policy parameter.
ATTRIBUTE: schedparam
The legal values for the schedparam attribute associated with the schedpolicy attribute vary depending
upon the scheduling policy. For the
SCHED_FIFO and SCHED_RR scheduling policies, only the
sched_priority member of the schedparam attribute is required. Legal values for sched_priority can be
obtained through
sched_get_priority_max() and sched_get_priority_min()
. The
required contents of schedparam for other scheduling policies is undefined. For a complete list of
required and valid scheduling parameters for all scheduling policies, refer to rtsched (2) and
<sched.h>.
pthread_attr_setschedparam() is used to set the schedparam attribute in the initialized attri-
butes object attr. The new value of the schedparam attribute is passed to this function in the param
parameter.
pthread_attr_getschedparam() retrieves the value of the schedparam attribute from the thread
attributes object attr . This value is returned in the param parameter.
ATTRIBUTE: contentionscope
The legal values for the contentionscope attribute are:
PTHREAD_SCOPE_SYSTEM
Threads created with this contention scope contend for resources with all other threads in the
Section 3740 Hewlett-Packard Company 4 HP-UX 11i Version 2: August 2003