Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.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
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_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.
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.
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running H06.21 or later RVUs or J06.10 or later RVUs, you must perform all of the fol-
lowing tasks:
• Include the pthread.h header file in the application.
527186-023 Hewlett-Packard Company 5−173