Standard C Library Functions pthreadgetschedparam(3C)
NAME
pthreadgetschedparam, pthreadsetschedparam - access
dynamic thread scheduling parameters
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include
int pthreadgetschedparam(pthreadt thread, int *restrict policy,
struct schedparam *restrict param);
int pthreadsetschedparam(pthreadt thread, int policy,
const struct schedparam *param);
DESCRIPTION
The pthreadgetschedparam() and pthreadsetschedparam()
functions allow the scheduling policy and scheduling parame-
ters of individual threads within a multithreaded process to
be retrieved and set. Supported policies are :
SCHEDOTHER traditional time-sharing scheduling class
SCHEDFIFO real-time class: run to completion
SCHEDR real-time class: round-robin
SCHEDIA interactive time-sharing class
SCHEDFS fair-share scheduling class
SCHEDFX fixed priority scheduling class
See pthreads(5). The affected scheduling parameter is the
schedpriority member of the schedparam structure.
The pthreadgetschedparam() function retrieves the schedul-
ing policy and scheduling parameters for the thread whose
thread ID is given by thread and stores those values in pol-
icy and param, respectively. The priority value returned
from pthreadgetschedparam() is the value specified by the
most recent pthreadsetschedparam() or pthreadcreate() call
affecting the target thread, and does not reflect any
SunOS 5.11 Last change: 1 Apr 2008 1
Standard C Library Functions pthreadgetschedparam(3C)
temporary adjustments to its priority as a result of any
priority inheritance or ceiling functions. The
pthreadsetschedparam() function sets the scheduling policy
and associated scheduling parameters for the thread whose
thread ID is given by thread to the policy and associated
parameters provided in policy and param, respectively.
If the pthreadsetschedparam() function fails, no scheduling
parameters will be changed for the target thread.
RETURN VALUES
If successful, the pthreadgetschedparam() and
pthreadsetschedparam() functions return 0. Otherwise, an
error number is returned to indicate the error.
ERORS
The pthreadgetschedparam() and pthreadgsetschedparam()
functions will fail if:
ESRCH The value specified by thread does not refer to an
existing thread.
The pthreadsetschedparam() function will fail if:
EINVAL The value specified by policy or one of the
scheduling parameters associated with the schedul-
ing policy policy is invalid.
EPERM The caller does not have the appropriate permis-
sion to set either the scheduling parameters or
the scheduling policy of the specified thread.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 1 Apr 2008 2
Standard C Library Functions pthreadgetschedparam(3C)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
Standard See standards(5).
SEE ALSO
pthreadattrinit(3C), schedgetparam(3C),
schedgetprioritymax(3C)schedgetprioritymax(3C),
schedgetprioritymin(3C), schedsetparam(3C),
schedgetscheduler(3C), schedsetscheduler(3C), attri-
butes(5), pthreads(5), standards(5)
SunOS 5.11 Last change: 1 Apr 2008 3
|