rtapi_prio_next_higher(3rtapi)

rtapi_prio_next_higher3rtapi

Thread priority functions

Part of rtapi_prio(3rtapi).

Usage

int rtapi_prio_highest()

int rtapi_prio_lowest()

int rtapi_prio_next_higher(int prio)

int rtapi_prio_next_lower(int prio)

Arguments

prio

A value returned by a prior rtapi_prio_xxx call

Overview

The rtapi_prio_xxxx functions provide a portable way to set task priority. The mapping of actual priority to priority number depends on the RTOS. Priorities range from rtapi_prio_lowest to rtapi_prio_highest, inclusive. To use this API, use one of two methods:

1)

Set your lowest priority task to rtapi_prio_lowest, and for each task of the next lowest priority, set their priorities to rtapi_prio_next_higher(previous).

2)

Set your highest priority task to rtapi_prio_highest, and for each task of the next highest priority, set their priorities to rtapi_prio_next_lower(previous).

N.B. A high priority task will preempt or interrupt a lower priority task. Linux is always the lowest priority!

Realtime considerations

Call these functions only from within init/cleanup code, not from realtime tasks.

Return value

Returns an opaque real-time priority number.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

From linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.