Читаем Programming with POSIX® Threads полностью

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: 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: 

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: 

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: 

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

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

values, for example, half and quarter points in range.

SCHED_FIFO

Перейти на страницу:

Похожие книги

C++: базовый курс
C++: базовый курс

В этой книге описаны все основные средства языка С++ - от элементарных понятий до супервозможностей. После рассмотрения основ программирования на C++ (переменных, операторов, инструкций управления, функций, классов и объектов) читатель освоит такие более сложные средства языка, как механизм обработки исключительных ситуаций (исключений), шаблоны, пространства имен, динамическая идентификация типов, стандартная библиотека шаблонов (STL), а также познакомится с расширенным набором ключевых слов, используемым в .NET-программировании. Автор справочника - общепризнанный авторитет в области программирования на языках C и C++, Java и C# - включил в текст своей книги и советы программистам, которые позволят повысить эффективность их работы. Книга рассчитана на широкий круг читателей, желающих изучить язык программирования С++.

Герберт Шилдт

Программирование, программы, базы данных
Delphi. Трюки и эффекты
Delphi. Трюки и эффекты

«Delphi. Трюки и эффекты», как и все издания данной серии, адресована тем, кто хочет научиться делать с помощью уже знакомых программных пакетов новые, интересные вещи. В первой части книги многое говорится о среде разработки Delphi (самых последних версий) и программировании на языке Object Pascal. Благодаря этому издание подходит и новичкам, и начинающим программистам. Вторая (основная) часть книги описывает удивительные возможности, скрытые в языке, и на примерах учит читателя программистским фокусам – от «мышек-невидимок» и «непослушных окон» до воспроизведения МРЗ и управления офисными программами Word и Excel из приложений Delphi. Купив эту книгу, вы пройдете непростой путь к вершинам программистского мастерства весело и интересно.

Валерий Викторович Борисок , Юрий Иванович Корвель , Александр Анатольевич Чиртик

Программирование, программы, базы данных