source: rtems/doc/posix_users/sched.t @ 68f54e1

4.104.114.84.95
Last change on this file since 68f54e1 was e2c8e2c, checked in by Joel Sherrill <joel.sherrill@…>, on 07/01/99 at 23:05:07

Filled in.

  • Property mode set to 100644
File size: 4.3 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Scheduler Manager
10
11@section Introduction
12
13The scheduler manager ...
14
15The directives provided by the scheduler manager are:
16
17@itemize @bullet
18@item @code{sched_get_priority_min} - Get Minimum Priority Value
19@item @code{sched_get_priority_max} - Get Maximum Priority Value
20@item @code{sched_rr_get_interval} - Get Timeslicing Quantum
21@item @code{sched_yield} - Yield the Processor
22@end itemize
23
24@section Background
25
26@subsection Priority
27
28In the RTEMS implementation of the POSIX API, the priorities range from
29the low priority of @code{sched_get_priority_min()} to the highest priority of
30@code{sched_get_priority_max()}.  Numerically higher values represent higher
31priorities.
32
33@subsection Scheduling Policies
34
35The following scheduling policies are available:
36
37@table @b
38@item SCHED_FIFO
39Priority-based, preemptive scheduling with no timeslicing.  This is equivalent
40to what is called "manual round-robin" scheduling.
41
42@item SCHED_RR
43Priority-based, preemptive scheduling with timeslicing.  Time quantums are
44maintained on a per-thread basis and are not reset at each context switch.
45Thus, a thread which is preempted and subsequently resumes execution will
46attempt to complete the unused portion of its time quantum.
47
48@item SCHED_OTHER
49Priority-based, preemptive scheduling with timeslicing.  Time quantums are
50maintained on a per-thread basis and are reset at each context switch.
51
52@item SCHED_SPORADIC
53Priority-based, preemptive scheduling utilizing three additional parameters:
54budget, replenishment period, and low priority.  Under this policy, the
55thread is allowed to execute for "budget" amount of time before its priority
56is lowered to "low priority".  At the end of each replenishment period,
57the thread resumes its initial priority and has its budget replenished.
58
59@end table
60
61@section Operations
62
63There is currently no text in this section.
64
65@section Directives
66
67This section details the scheduler manager's directives.
68A subsection is dedicated to each of this manager's directives
69and describes the calling sequence, related constants, usage,
70and status codes.
71
72@page
73@subsection sched_get_priority_min - Get Minimum Priority Value
74
75@subheading CALLING SEQUENCE:
76
77@example
78#include <sched.h>
79
80int sched_get_priority_min(
81  int policy
82);
83@end example
84
85@subheading STATUS CODES:
86
87On error, this routine returns -1 and sets errno to one of the following:
88
89@table @b
90@item EINVAL
91The indicated policy is invalid.
92 
93@end table
94
95@subheading DESCRIPTION:
96
97This routine return the minimum (numerically and logically lowest) priority
98for the specified @code{policy}.
99
100@subheading NOTES:
101
102NONE
103
104@page
105@subsection sched_get_priority_max - Get Maximum Priority Value
106
107@subheading CALLING SEQUENCE:
108
109@example
110#include <sched.h>
111
112int sched_get_priority_max(
113  int policy
114);
115@end example
116
117@subheading STATUS CODES:
118
119On error, this routine returns -1 and sets errno to one of the following:
120
121@table @b
122@item EINVAL
123The indicated policy is invalid.
124 
125@end table
126
127@subheading DESCRIPTION:
128
129This routine return the maximum (numerically and logically highest) priority
130for the specified @code{policy}.
131
132@subheading NOTES:
133
134NONE
135
136@page
137@subsection sched_rr_get_interval - Get Timeslicing Quantum
138
139@subheading CALLING SEQUENCE:
140
141@example
142#include <sched.h>
143
144int sched_rr_get_interval(
145  pid_t            pid,
146  struct timespec *interval
147);
148@end example
149
150@subheading STATUS CODES:
151
152On error, this routine returns -1 and sets errno to one of the following:
153
154@table @b
155@item ESRCH
156The indicated process id is invalid.
157 
158@item EINVAL
159The specified interval pointer parameter is invalid.
160
161@end table
162
163@subheading DESCRIPTION:
164
165This routine returns the length of the timeslice quantum in the
166@code{interval} parameter for the specified @code{pid}.
167
168@subheading NOTES:
169
170The @code{pid} argument should be 0 to indicate the calling process.
171
172@page
173@subsection sched_yield - Yield the Processor
174
175@subheading CALLING SEQUENCE:
176
177@example
178#include <sched.h>
179
180int sched_yield( void );
181@end example
182
183@subheading STATUS CODES:
184
185This routine always returns zero to indicate success.
186
187@subheading DESCRIPTION:
188
189This call forces the calling thread to yield the processor to another
190thread.  Normally this is used to implement voluntary round-robin
191task scheduling.
192
193@subheading NOTES:
194
195NONE
Note: See TracBrowser for help on using the repository browser.