Index of Section 2 Manual Pages
| Interix / SUA | pthread_attr_setschedparam.2 | Interix / SUA |
pthread_attr_setschedparam(2) pthread_attr_setschedparam(2)
pthread_attr_getschedparam()
NAME
pthread_attr_getschedparam(), pthread_attr_setschedparam() - get or set
the thread scheduling parameters attribute
SYNOPSIS
#include
int pthread_attr_getschedparam(const pthread_attr_t *attr, struct
sched_param *param);
int pthread_attr_setschedparam(pthread_attr_t *attr, const struct
sched_param *param);
DESCRIPTION
The pthread_attr_setschedparam(2) sets the scheduling parameters attribute
in the thread attributes object referenced by attr by using the values in
the sched_param structure referenced by the param argument. The
sched_param structure, defined in contains the following fields:
struct sched_param {
int sched_priority; /* scheduling priority */
int sched_nicelim; /* nice value limit for SCHED_OTHER policy */
int sched_nice; /* nice value for SCHED_OTHER policy */
int sched_pad[6]; /* this is used for padding */
};
After the attributes have been set in the thread attributes object
referenced by attr, the pthread_create(2) function can be called to create
a new thread with the specified attributes. The effective thread priority
of the new thread is equal to the process priority (determined from the
nice(2) value of the process) plus the thread priority that is set by this
function. This function does not affect the current running thread.
NOTE: In this version of Interix, only the sched_priority field of the
sched_param structure is supported. Other fields are ignored.
The pthread_attr_getschedparam(2) function retrieves the scheduling
parameter attributes of the thread object referenced by attr, storing the
value in the location referenced by the param argument.
RETURN VALUES
On success, both functions return 0; otherwise, they return an error
number.
ERRORS
The pthread_attr_setschedparam() function can fail for the following
reasons:
[EINVAL]
The param argument is invalid.
[ENOTSUP]
An attempt was made to set the scheduling parameters attribute to an
unsupported value.
Neither function returns [EINTR].
SEE ALSO
pthread_attr_destroy(2)
pthread_attr_getinheritsched(2)
pthread_attr_getschedpolicy(2)
pthread_attr_getscope(2)
pthread_create(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.