Professional Multicore Programming: Design and Implementation for C++ Developers
by Cameron Hughes, Tracey Hughes
Name
NAME
pthread_getschedparam, pthread_setschedparam — dynamic thread scheduling parameters access (REALTIME THREADS)
SYNOPSIS
THR TPS #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) ;DESCRIPTION
The pthread_getschedparam() and pthread_setschedparam() functions shall, respectively, get and set the scheduling policy and parameters of individual threads within a multi-threaded process to be retrieved and set. For SCHED_FIFO and SCHED_RR, the only required member of the sched_param structure is the priority sched_priority. For SCHED_OTHER, the affected scheduling parameters are implementation-defined.
The pthread_getschedparam() function shall retrieve the scheduling policy and scheduling parameters for the thread whose thread ID is given by thread and shall store those values in policy and param, respectively. The priority value returned from pthread_getschedparam() shall be the value specified by the most recent pthread_setschedparam(), pthread_setschedprio(), or pthread_create{) call affecting the target thread. It shall not reflect any temporary adjustments to its priority as a result of any priority inheritance or ceiling functions. The pthread_setschedparam() function shall set the scheduling policy and associated scheduling parameters for the thread whose thread ID is given by thread to the policy and associated parameters ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access