Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (n - p) pthread_setschedparam(2)
NAME
pthread_setschedparam
- Sets the scheduling policy and scheduling parameters of a thread
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int pthread_setschedparam(
pthread_t thread,
int policy,
const struct sched_param *param );
PARAMETERS
thread specifies the thread whose scheduling policy and parameters are to be set.
policy specifies the new scheduling policy value for the thread specified by the thread
parameter. Valid values are:
SCHED_FIFO
param specifies one or more new values for the scheduling parameters associated with
the scheduling policy specified by the policy parameter. Valid values for the
sched_priority field of a sched_param structure depend on the chosen schedul-
ing policy. Use the sched_get_priority_min() and sched_get_priority_max()
functions to determine the low and high limits of each scheduling policy. The
default priority is 24.
DESCRIPTION
This function sets both the current scheduling policy and scheduling parameters of the thread
specified by the thread parameter to the policy and parameters provided by the policy and param
parameters, respectively.
The scheduling policies of all threads have one scheduling attribute named sched_priority.For
the scheduling policy you choose, you must specify an appropriate value in the sched_priority
field of the sched_param structure.
Changing the scheduling policy, priority, or both, of a thread can cause it to start executing or to
be preempted by another thread. A thread sets its own scheduling policy and priority by using
the handle returned by the pthread_self( ) function.
NOTES
This function differs from the pthread_attr_setschedpolicy() and
pthread_attr_setschedparam() functions, which set the scheduling policy and scheduling
parameters used to establish the priority and scheduling policy of a new thread when it is created.
However, pthread_setschedparam( ) sets the scheduling policy and scheduling parameters of an
existing thread.
RETURN VALUES
If an error condition occurs, no scheduling policy or parameters are changed for the thread
thread, and this function returns an integer value indicating the type of error. Possible return
values are:
0 Successful completion.
527186-003 Hewlett-Packard Company 5−95