HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)
p
pthread_attr_getdetachstate(3T) pthread_attr_getdetachstate(3T)
(Pthread Library)
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 (not bound to any particular kernel-scheduled
entity).
The default value of the contentionscope attribute is not defined by POSIX.1c. The default value of the con-
tentionscope attribute is set to be
PTHREAD_SCOPE_SYSTEM. This default scope can also be controlled
externally by using the options documented in the pthread_scope_options(5) manpage.
pthread_attr_setscope() is used to set the contentionscope attribute in the initialized attributes
object attr. The new value of the contentionscope attribute is passed to this function in the contentionscope
parameter.
pthread_attr_getscope() retrieves the value of the contentionscope attribute from the thread
attributes object attr. This value is returned in the contentionscope parameter.
ATTRIBUTES: processor and binding_type
The legal values for the processor attribute are:
166 Hewlett-Packard Company − 5 − HP-UX 11i Version 3: February 2007