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

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

SCHED_RR

SCHED_OTHER

[_POSIX_PRIORITY_SCHEDULING]

sched_get_priority_min.........................................................

int sched_get_priority_min (

int policy);

Return the minimum integer priority allowed for the specified scheduling policy.

References: 5.5.2 Headers: <sched.h>

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.

policy
SCHED_ _FIFO Run thread until it blocks;
preempt lower-priority
threads when ready.
SCHED_ _RR Like SCHED_FIFO, but sub-
ject to periodic timeslicing.
SCHED_ OTHER Implementation defined (may
be SCHED_FIFO, SCHED_RR,
or something else).

9.3.9 Fork handlers

Pthreads provides some new functions to help the new threaded environment to coexist with the traditional process-based UNIX environment. Creation of a child process by copying the full address space, for example, causes problems for threaded applications because the fork call is asynchronous with respect to other threads in the process.

pthread_atfork

int pthread_atfork (

void (*prepare)(void),

void (*parent)(void),

void (*child)(void));

Define 'fork handlers' that are run when the process creates a child process. Allows protection of synchronization objects and shared data in the child process (which is otherwise difficult to control).

References: 6.1.1

Headers: <unistd.h>*[10]

Errors: [ENOMEM] insufficient space to record the handlers.

Hint: All resources needed by child must be protected.

9.3.10 Stdio

Pthreads provides some new functions, and new versions of old functions, to access ANSI C stdio features safely from a threaded process. For safety reasons, the old forms of single-character access to stdio buffers have been altered to lock the file stream, which can decrease performance. You can change old code to instead lock the file stream manually and, within that locked region, use new character access operations that do not lock the file stream.

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

0

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

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