Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pod_getmaxsize(3L) — SunOS 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

POD_SETMAXPRI(3L)  —  LIGHTWEIGHT PROCESSES LIBRARY

NAME

pod_setmaxpri, pod_getmaxpri, pod_getmaxsize − control LWP scheduling priority

SYNOPSIS

int
pod_setmaxpri(maxprio)
int maxprio;

int
pod_getmaxpri()

int
pod_getmaxsize()

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 VALUE

pod_setmaxpri() returns 0 if success; else −1. 

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

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

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. 

Sun Release 4.0  —  Last change: 6 October 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026