Returns the current schedpolicy and schedparam attributes of a thread.
Threads Library (libpthreads.a)
#include <pthread.h> #include <sys/sched.h> int pthread_setschedparam (thread, schedpolicy, schedparam) pthread_t thread; int schedpolicy; const struct sched_param *schedparam;
The pthread_setschedparam subroutine dynamically sets the schedpolicy and schedparam attributes of the thread thread. The schedpolicy attribute specifies the scheduling policy of the thread. The schedparam attribute specifies the scheduling parameters of a thread created with this attributes object. The sched_priority field of the sched_param structure contains the priority of the thread. It is an integer value.
If the target thread has system contention scope, the process must have root authority to set the scheduling policy to either SCHED_FIFO or SCHED_RR.
This subroutine is part of the Base Operating System (BOS) Runtime. The implementation of this subroutine is dependent on the priority scheduling POSIX option. The priority scheduling POSIX option is implemented in the operating system.
Upon successful completion, 0 is returned. Otherwise, an error code is returned.
The pthread_setschedparam subroutine is unsuccessful if the following is true:
EINVAL | The thread or schedparam parameters are not valid. |
ENOSYS | The priority scheduling POSIX option is not implemented. |
ENOTSUP | The value of the schedpolicy or schedparam attributes are not supported. |
EPERM | The target thread has insufficient permission to perform the operation or is already engaged in a mutex protocol. |
ESRCH | The thread thread does not exist. |
The pthread_getschedparam (pthread_getschedparam Subroutine) subroutine, pthread_attr_setschedparam (pthread_attr_setschedparam Subroutine) subroutine.
Threads Scheduling in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Threads Library Options in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.