|HP-UX Reference > P
HP-UX 11i Version 3: February 2007
pthread_getschedparam(), pthread_setschedparam() — get or set the scheduling policy and associated parameters
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 );
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.
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 policies have implementation-defined scheduling policies. Refer to the documentation for rtsched(2) and <sched.h> for further information on implementation-defined scheduling policies.
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).
If any of the following occur, the pthread_getschedparam() and pthread_setschedparam() functions return the corresponding error number:
For each of the following conditions, if the condition is detected, the pthread_setschedparam() function returns the corresponding error number:
For each of the following conditions, if the condition is detected, the pthread_getschedparam() function returns the corresponding error number:
pthread_getschedparam() and pthread_setschedparam() were derived from the IEEE POSIX P1003.1c standard.
pthread_attr_setschedparam(3T), pthread_attr_setschedpolicy(3T), pthread_attr_getschedparam(3T), pthread_attr_getschedpolicy(3T), rtsched(2).