pthread_getschedparam.3t (2010 09)

p
pthread_getschedparam(3T) pthread_getschedparam(3T)
(Pthread Library)
NAME
pthread_getschedparam(), pthread_setschedparam() - get or set the scheduling policy and associated
parameters
SYNOPSIS
#include <pthread.h>
int pthread_getschedparam(
pthread_t thread,
int *__restrict policy,
struct sched_param *__restrict param
);
int pthread_setschedparam(
pthread_t thread,
int policy,
const struct sched_param *param
);
PARAMETERS
thread The thread whose scheduling policy and associated parameters are to be set/retrieved.
policy This parameter either points to the memory location where the scheduling policy of
thread is returned (get function) or it specifies the new value of the scheduling policy for
thread (set function).
param This parameter either points to the memory location where the scheduling parameters of
thread are returned (get function) or it specifies the new scheduling parameters for
thread (set function).
DESCRIPTION
These functions allow the scheduling policy and associated parameters of threads within a multithreaded
process to be retrieved and changed. The legal values for the scheduling policy and associated scheduling
parameters are defined in
<sched.h>.
pthread_setschedparam()
changes the scheduling policy and associated scheduling parameters for
thread to the policy and the associated parameters provided in policy and param , respectively. On HP-
UX, appropriate privileges are required to change the scheduling parameters of a thread. The calling
process must have appropriate privileges or be a member of a group having
PRIV_RTSCHED access to
successfully call pthread_setschedparam()
.
The
pthread_getschedparam()
function retrieves the scheduling policy and associated parameters
for thread and stores those values in policy and param , respectively. The values returned represent the
actual scheduling values, not any temporary values that may be in effect due to priority inheritance or
priority ceiling features.
Notes
For the
SCHED_FIFO and SCHED_RR scheduling policies, only the sched_priority member of the
sched_param structure is required in the associated scheduling parameters. All other scheduling poli-
cies have implementation-defined scheduling policies. Refer to the documentation for rtsched (2) and
<sched.h> for further information on implementation-defined scheduling policies.
RETURN VALUE
Upon successful completion,
pthread_setschedparam() and pthread_getschedparam()
return zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set).
ERRORS
If any of the following occur, the
pthread_getschedparam() and pthread_setschedparam()
functions return the corresponding error number:
[ENOSYS]
_POSIX_THREAD_PRIORITY_SCHEDULING is not defined and these functions
are not supported.
For each of the following conditions, if the condition is detected, the
pthread_setschedparam()
function returns the corresponding error number:
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)