Determine the priority ceiling at which threads will run while owning a mutex created with attr.
References: 3.2, 5.2.1, 5.5.5 Headers:
Errors: [ENOSYS]
priority scheduling is not supported.[EINVAL] attr invalid. Hint:
also creates and controls all threads that might lock the mutex.
pthread_mutexattr_getprotocol... [_POSIX_THREAD_PRIO_INHERIT_POSIX_THREAD_PRIO_PROTECT]
int pthread_mutexattr_getprotocol (
const pthread_mutexattr_t *attr,
int *protocol);
Determine whether mutexes created with attr have priority ceiling protocol
protocol
PTHREAD_PRIO_NONE
No priority inheritanceprotocol.
PTHREAD_PRIO_INHERIT While owning mutex, thread
inherits highest priority of any thread waiting for the mutex.
PTHREAD_PRIO_PROTECT While owning mutex, thread
inherits mutex priority ceiling.
References: 3.2,5.2.1,5.5.5 Headers:
Errors: [ENOSYS]
priority scheduling is not supported.[EINVAL] attr invalid. Hint:
unless the creator of the mutex also creates and controls all threads
that might lock the mutex.
pthread_mutexattr_setprioceiling...............................................[_POSIX_THREAD_PRIO_PROTECT
]int pthread_mutexattr_setprioceiling ( pthread_mutexattr_t *attr,
int prioceiling);
Specify the priority ceiling at which threads will run while owning a mutex created with attr. The value of prioceiling must be a valid priority parameter for the
SCHED_FIFO policy.
References: 3.2,5.2.1,5.5.5 Headers:
Errors: [ENOSYS]
priority scheduling is not supported.[EINVAL] attr or prioceiling invalid.
[EPERM] no permission to set prioceiling. Hint:
also creates and controls all threads that might lock the mutex.
pthread_mutexattr_setprotocol
.... [_POSIX_THREAD_PRIO_INHERIT_POSIX_THREAD_PRIO_PROTECT]int pthread_mutexattr_setprotocol (
pthread_mutexattr_t *attr,
int protocol);
Specify whether mutexes created with attr have priority ceiling protocol
protocol
PTHREAD_PRIO_NONE
No priority inheritanceprotocol.
PTHREAD_PRIO_INHERIT While owning mutex, thread
inherits highest priority of any thread waiting for the mutex.
PTHREAD_PRIO_PROTECT While owning mutex, thread
inherits mutex priority ceiling.
References: 3.2,5.2.1,5.5.5 Headers:
Errors: [ENOSYS]
priority scheduling is not supported.[EINVAL] attr or protocol invalid.
[ENOTSUP]
protocol value is not supported. Hint:unless the creator of the mutex also creates and controls all threads
that might lock the mutex.
pthread_setschedparam..............................................[_POSIX_THREAD_PRIORITY_SCHEDULING]
int pthread_setschedparam (
pthread_t thread,
int policy
const struct sched_param *param);
Specify the scheduling policy and parameters (param) to be used by thread.
policy
SCHED_FIFO
SCHED_RR
Run thread until it blocks; preempt lower-priority threads when ready.
Like SCHED_FIFO, but subject to periodic timeslicing.
SCHED_OTHER
Implementation defined (may be SCHED_FIFO, SCHED_RR, or something else).
References:
Headers:
Errors:
Hint:
5.5
[ENOSYS]
priority scheduling is not supported.[ESRCH] thread does not refer to an existing thread.
[EINVAL] policy or param is invalid.
[ENOTSUP] policy or param is unsupported value.
[EPERM] no permission to set policy or param.
Try to avoid dynamically modifying thread scheduling policy and
parameters, if possible.
sched_get_priority_max..............................................................[_POSIX_PRIORITY_SCHEDULING]
int sched_get_priority_max (
int policy);
Return the maximum integer priority allowed for the specified scheduling policy.
policy
Run thread until it blocks; preempt lower-priority threads when ready.
Like SCHED_FIFO,
but subject to periodic timeslicing.Implementation defined (may be SCHED_FIFO, SCHED_RR, or something else).
References: 5.5.2
Headers:Errors: [ENOSYS
] priority scheduling is not supported.[EINVAL]
policy is invalid. Hint: Priority min and max are integer values—you can compute relativevalues, for example, half and quarter points in range.
SCHED_FIFO