Sets the value of the schedparam attribute of a thread attributes object.
Threads Library (libpthreads.a)
#include <pthread.h> #include <sys/sched.h>
int pthread_attr_setschedparam ( attr, schedparam)
pthread_attr_t *attr;
const struct sched_param *schedparam;
The pthread_attr_setschedparam subroutine sets the value of the schedparam attribute of the thread attributes object attr. 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.
Note: The pthread.h header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.
Upon successful completion, 0 is returned. Otherwise, an error code is returned.
The
pthread_attr_setschedparam subroutine is unsuccessful if the
following is true:
EINVAL | The attr parameter is not valid. |
ENOSYS | The priority scheduling POSIX option is not implemented. |
ENOTSUP | The value of the schedparam attribute is not supported. |
This subroutine is part of the Base Operating System (BOS) Runtime.
The pthread_attr_getschedparam (pthread_attr_getschedparam Subroutine) subroutine, pthread_attr_init (pthread_attr_init Subroutine) subroutine, pthread_create (pthread_create Subroutine) subroutine, the pthread.h file.
Threads Scheduling in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.
Threads Library Options and Threads Library Quick Reference in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.