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 species the address of the thread attributes object whose inherit scheduling
attribute is to be set.
inheritsched species 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 specied 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 specied
by the pthread_create() attr parameter.
DESCRIPTION
This function sets the value of the inherit scheduling attribute of the thread attributes object
specied by the attr parameter to the value specied by the inheritsched parameter. The inherit
scheduling attribute species whether threads created using the specied thread attributes object
inherit the scheduling attributes of the creating thread or use the scheduling attributes stored in
the thread attributes object specied by the pthread_create() attr parameter.
The default scheduling policy for the rst thread in an application is SCHED_FIFO, and cannot
be modied.
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 specied by the attr parameter is not a valid thread attributes object or
the inheritsched parameter contains an invalid value.
532 Hewlett-Packard Company 527186-003