[EINVAL] mutex invalid, or prioceiling out of range.

[EPERM] no privilege to set prioceiling. Hint: Protect protocol is inappropriate unless the creator of the mutex

also creates and controls all threads that might lock the mutex.

pthread_mutexattr_getprioceiling............................................. [_POSIX_THREAD_PRIO_PROTECT ]

int pthread_mutexattr_getprioceiling (

const pthread_mutexattr_t *attr,

int *prioceiling);

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: <pthread.h>

Errors: [ENOSYS] priority scheduling is not supported.

[EINVAL] attr invalid. Hint: Protect protocol is inappropriate unless the creator of the mutex

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 protect), priority inheritance protocol (inherit), or no priority protocol (none).

protocol

PTHREAD_PRIO_NONE No priority inheritance

protocol.

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: <pthread.h>

Errors: [ENOSYS] priority scheduling is not supported.

[EINVAL] attr invalid. Hint: Inherit protocol is expensive, and protect protocol is inappropriate

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: <pthread.h>

Errors: [ENOSYS] priority scheduling is not supported.

[EINVAL] attr or prioceiling invalid.

[EPERM] no permission to set prioceiling. Hint: Protect protocol is inappropriate unless the creator of the mutex

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 protect), priority inheritance protocol (inherit), or no priority protocol (none).

protocol

PTHREAD_PRIO_NONE No priority inheritance

protocol.

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: <pthread.h>

Errors: [ENOSYS] priority scheduling is not supported.

[EINVAL] attr or protocol invalid.

[ENOTSUP] protocol value is not supported. Hint: Inherit protocol is expensive, and protect protocol is inappropriate

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

<pthread.h>

[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]

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату