pthread_setschedparam, pthread_getschedparam - change thread scheduling
int pthread_setschedparam(pthread_t thread, int policy,
const struct sched_param *param);
int pthread_getschedparam(pthread_t thread, int *opolicy,
struct sched_param *oparam);
The pthread_setschedparam() function changes the scheduling policy and
parameters of the thread identified by thread to the values specified by
policy and param. Changing the scheduling characteristics of an existing
thread is similar to creating the thread with those attributes [see
pthread_attr_setschedpolicy() and pthread_attr_setschedparam()]. Only
the assigned thread priority is changed - a temporary priority elevation
obtained by acquiring a mutex is not affected [see
The pthread_getschedparam() function returns the scheduling policy and
parameters of the thread identified by thread via the opolicy and oparam
parameters. The assigned thread priority is returned in the
sched_priority field of sched_param; the actual priority may be
temporarily higher if the thread is holding a priority elevating mutex.
On success pthread_setschedparam() and pthread_getschedparam() return
zero; otherwise an error number is returned:
[ESRCH] The thread parameter does not identify a thread.
[EPERM] The caller lacks sufficient privilege to change the
scheduling attributes of thread.
PPPPaaaaggggeeee 1111 [ Back ]