HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
p
pthread_attr(3T) pthread_attr(3T)
(Pthread Library)
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 pol-
icy. To use this attribute, the inheritsched attribute must be set to
PTHREAD_EXPLICIT_SCHED
.Fora
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 param-
eter.
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
system (and within the same scheduling domain). This attribute is generally used to indicate
that the user thread should be bound directly to a kernel-scheduled entity.
PTHREAD_SCOPE_PROCESS
Threads created with this contention scope contend directly with other threads within their pro-
cess that were created with this scheduling contention scope. This attribute is generally used to
indicate that the user thread should be unbound (in the Mx1 and MxN Threads Model).
HP-UX 11i Version 1: September 2005 − 4 − Hewlett-Packard Company Section 3−−683