Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (n - p) pthread_attr_setinheritsched(2)
NAME
pthread_attr_setinheritsched - Sets the inherit scheduling attribute of a thread attributes object
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <pthread.h> | #include <spthread.h>
/* pthread.h is required to use POSIX User Thread Model library */
/* spthread.h is required to use Standard POSIX Threads library */
int pthread_attr_setinheritsched(
pthread_attr_t *attr,
int inheritsched);
PARAMETERS
attr Specifies the address of the thread attributes object whose inherit scheduling
attribute is to be set.
inheritsched Specifies the new value for the inherit scheduling attribute. Valid values are:
PTHREAD_INHERIT_SCHED
The created thread inherits the scheduling policy and associated
scheduling attributes of the thread calling the pthread_create()
function. Any scheduling attributes in the thread attributes
object specified by the pthread_create() attr parameter are
ignored during thread creation.
PTHREAD_EXPLICIT_SCHED
This is the default value. The scheduling policy and associated
scheduling attributes of the created thread are set to the
corresponding values from the thread attributes object specified
by the pthread_create() attr parameter.
DESCRIPTION
This function sets the value of the inherit scheduling attribute of the thread attributes object
specified by the attr parameter to the value specified by the inheritsched parameter. The inherit
scheduling attribute specifies whether threads created using the specified thread attributes object
inherit the scheduling attributes of the creating thread or use the scheduling attributes stored in
the thread attributes object specified by the pthread_create() attr parameter.
The default scheduling policy for the first thread in an application is SCHED_FIFO, and cannot
be modified.
Inheriting scheduling attributes is useful when a thread is creating several helper threads — that
is, threads that are intended to work closely with the creating thread to cooperatively solve the
same problem. For example, inherited scheduling attributes ensure that helper threads created in
a sort routine execute with the same priority as the calling thread.
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
527186-023 Hewlett-Packard Company 561