POD_GETMAXPRI(3L)

NAME
pod_getmaxpri, pod_getmaxsize, pod_setmaxpri - control LWP scheduling priority

SYNOPSIS

int pod_getmaxpri()

int pod_getmaxsize()

int pod_setmaxpri(maxprio)
int maxprio;

DESCRIPTION

The LWP library is self-initializing: the first time you use a primitive that requires threads to be supported, main is automatically converted into a thread. A pod will terminate when all client-created lightweight threads (including the thread bound to main) are dead.

By default, only a single priority (MINPRIO) is available. However, by using pod_setmaxpri(), you can make an arbitrary number (up to the limit imposed by the implementation) of priorities available. The main thread will receive the highest available scheduling priority at the time of initialization. By using pod_setmaxpri() before any other LWP primitives, you can ensure that main will receive the same priority as the argument to pod_setmaxpri(). pod_setmaxpri() can be called repeatedly, as long as the number of scheduling priorities (maxprio) increases with each call.

pod_getmaxpri() returns the current number of available priorities. Priorities are numbered from 1 (MINPRIO) to MAXPRIO.

The implementation-dependent maximum number of priorities available can be retrieved using pod_getmaxsize(). This value will never be less than 255.

RETURN VALUES

pod_getmaxpri() returns the number of priority levels set by the most recent call to pod_setmaxpri().

pod_getmaxsize() returns the maximum number of priorities your system supports.

pod_setmaxpri() returns:

0   on success.

-1  on failure.

ERRORS

pod_setmaxpri() will fail if one or more of the following are true:

LE_INVALIDARG
    Attempt to allocate more priorities than supported.

LE_NOROOM
    No internal memory left to create pod.