summaryrefslogtreecommitdiff
path: root/docs/man/man3/rtapi_prio.3rtapi
blob: 67111331a9e05d59bde209ee69f438fb4a65712d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.TH rtapi_prio "3rtapi" "2006-10-12" "LinuxCNC Documentation" "RTAPI"
.SH NAME

rtapi_prio \- thread priority functions

.SH SYNTAX
.HP
int rtapi_prio_highest()
.HP
int rtapi_prio_lowest()
.HP
int rtapi_prio_next_higher(int \fIprio\fR)
.HP
int rtapi_prio_next_lower(int \fIprio\fR)

.SH  ARGUMENTS
.IP \fIprio\fR
A value returned by a prior \fBrtapi_prio_xxx\fR call

.SH DESCRIPTION
The \fBrtapi_prio_xxxx\fR functions provide a portable way to set task
priority.  The mapping of actual priority to priority number depends on the
RTOS.  Priorities range from \fBrtapi_prio_lowest\fR to
\fBrtapi_prio_highest\fR, inclusive. To use this API, use one of two methods:

.IP 1)
Set your lowest priority task to \fBrtapi_prio_lowest\fR, and for
each task of the next lowest priority, set their priorities to
\fBrtapi_prio_next_higher(previous)\fR.

.IP 2)
Set your highest priority task to \fBrtapi_prio_highest\fR, and
for each task of the next highest priority, set their priorities
to \fBrtapi_prio_next_lower(previous)\fR.

.PP
N.B. A high priority task will pre-empt or interrupt a lower priority
task. Linux is always the lowest priority!

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

.SH RETURN VALUE
Returns an opaque real-time priority number.

.SH SEE ALSO
\fBrtapi_task_new(3rtapi)\fR