#include <pthread.h>
int
pthread_getschedparam
(pthread_t thread , int *
policy , struct sched_param * param );
The pthread_setschedparam and pthread_getschedparam functions allow the scheduling policy and scheduling priority parameters to be set and retrieved for individual threads.
The pthread_getschedparam function retrieves the scheduling policy and scheduling priority parameters for the thread ID given by thread, and then stores the values in the policy and sched_priority member of param, respectively.
The pthread_getschedparam function returns -1 and sets errno if there is an error.
The value for policy must be SCHED_FIFO.
Section 14.3.2 |
#include <pthread.h>
int
pthread_setschedparam
(pthread_t thread , int
policy , struct sched_param * param );
The pthread_setschedparam and pthread_getschedparam functions allow the scheduling policy and scheduling priority parameters to be set and retrieved for individual threads.
The pthread_setschedparam function sets the scheduling policy and related scheduling priority for the thread ID given by thread to the policy and associated priority provided in policy, and the sched_priority member of param, respectively.
The pthread_setschedparam function returns 1 and sets errno in th event of an error.
The value for policy must be SCHED_FIFO.
Section 14.3.1 |
#include <pthread.h>
int
sched_get_priority_max
(int policy );
The sched_get_priority_max function returns the first value in the range of priorities for the given policy.
The sched_get_priority_max function returns the priority.
The range of priority is 0 .. 100. The lowest priority is 0. The highest priority is 100.
The value for policy must be SCHED_FIFO.
#include <pthread.h>
int
sched_get_priority_min
(int policy );
The sched_get_priority_min function returns the first value in the range of priorities for the given policy.
The sched_get_priority_min function returns the priority.
The range of priority is 0 .. 100. The lowest priority is 0. The highest priority is 100.
The value for policy must be SCHED_FIFO.
#include <pthread.h>
int
sched_yield
( );
The sched_yield function yields the processor to another thread.
The sched_yield function returns 0.
None.