Open System Services System Calls Reference Manual (G06.25+, H06.03+)
pthread_attr_setinheritsched(2) OSS System Calls Reference Manual
NAME
pthread_attr_setinheritsched
- Sets the inherit scheduling attribute of a thread attributes object
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
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.
RETURN VALUES
If an error condition occurs, this function returns an integer value indicating the type of error.
Possible return values are:
0 Successful completion.
[EINVAL] The value specified by the attr parameter is not a valid thread attributes object or
the inheritsched parameter contains an invalid value.
5−32 Hewlett-Packard Company 527186-003