source: rtems/doc/posix_users/sched.t @ 0660b4f8

4.104.114.84.95
Last change on this file since 0660b4f8 was 0660b4f8, checked in by Joel Sherrill <joel.sherrill@…>, on 11/16/99 at 19:50:56

Changed copyright date to 1999.

  • Property mode set to 100644
File size: 4.5 KB
RevLine 
[ae68ff0]1@c
[0660b4f8]2@c COPYRIGHT (c) 1988-1999.
[7479042]3@c On-Line Applications Research Corporation (OAR).
4@c All rights reserved.
[ae68ff0]5@c
[7479042]6@c $Id$
[139b2e4a]7@c
[ae68ff0]8
9@chapter Scheduler Manager
[c4dddee]10
[ae68ff0]11@section Introduction
12
13The scheduler manager ...
14
15The directives provided by the scheduler manager are:
16
17@itemize @bullet
[e2c8e2c]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
[ae68ff0]22@end itemize
23
24@section Background
[c4dddee]25
[ae68ff0]26@subsection Priority
27
28In the RTEMS implementation of the POSIX API, the priorities range from
[e2c8e2c]29the low priority of @code{sched_get_priority_min()} to the highest priority of
[7479042]30@code{sched_get_priority_max()}. Numerically higher values represent higher
[ae68ff0]31priorities.
32
33@subsection Scheduling Policies
34
35The following scheduling policies are available:
36
37@table @b
38@item SCHED_FIFO
[7479042]39Priority-based, preemptive scheduling with no timeslicing. This is equivalent
[ae68ff0]40to what is called "manual round-robin" scheduling.
41
42@item SCHED_RR
[7479042]43Priority-based, preemptive scheduling with timeslicing. Time quantums are
[ae68ff0]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
[7479042]49Priority-based, preemptive scheduling with timeslicing. Time quantums are
[ae68ff0]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:
[7479042]54budget, replenishment period, and low priority. Under this policy, the
[ae68ff0]55thread is allowed to execute for "budget" amount of time before its priority
[7479042]56is lowered to "low priority". At the end of each replenishment period,
[ae68ff0]57the thread resumes its initial priority and has its budget replenished.
58
59@end table
60
61@section Operations
62
[c4dddee]63There is currently no text in this section.
64
[ae68ff0]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
[7479042]72@c
73@c
74@c
[ae68ff0]75@page
[e2c8e2c]76@subsection sched_get_priority_min - Get Minimum Priority Value
[ae68ff0]77
[7479042]78@findex sched_get_priority_min
79@cindex  get minimum priority value
80
[ae68ff0]81@subheading CALLING SEQUENCE:
82
83@example
84#include <sched.h>
85
86int sched_get_priority_min(
[7479042]87int policy
[ae68ff0]88);
89@end example
90
91@subheading STATUS CODES:
92
93On error, this routine returns -1 and sets errno to one of the following:
94
95@table @b
96@item EINVAL
97The indicated policy is invalid.
[7479042]98
[ae68ff0]99@end table
100
101@subheading DESCRIPTION:
102
[e2c8e2c]103This routine return the minimum (numerically and logically lowest) priority
104for the specified @code{policy}.
105
[ae68ff0]106@subheading NOTES:
107
[e2c8e2c]108NONE
109
[7479042]110@c
111@c
112@c
[ae68ff0]113@page
[e2c8e2c]114@subsection sched_get_priority_max - Get Maximum Priority Value
[ae68ff0]115
[7479042]116@findex sched_get_priority_max
117@cindex  get maximum priority value
118
[ae68ff0]119@subheading CALLING SEQUENCE:
120
121@example
122#include <sched.h>
123
124int sched_get_priority_max(
[7479042]125int policy
[ae68ff0]126);
127@end example
128
129@subheading STATUS CODES:
130
131On error, this routine returns -1 and sets errno to one of the following:
132
133@table @b
134@item EINVAL
135The indicated policy is invalid.
[7479042]136
[ae68ff0]137@end table
138
139@subheading DESCRIPTION:
140
[e2c8e2c]141This routine return the maximum (numerically and logically highest) priority
142for the specified @code{policy}.
143
[ae68ff0]144@subheading NOTES:
145
[e2c8e2c]146NONE
147
[7479042]148@c
149@c
150@c
[ae68ff0]151@page
[e2c8e2c]152@subsection sched_rr_get_interval - Get Timeslicing Quantum
[ae68ff0]153
[7479042]154@findex sched_rr_get_interval
155@cindex  get timeslicing quantum
156
[ae68ff0]157@subheading CALLING SEQUENCE:
158
159@example
160#include <sched.h>
161
162int sched_rr_get_interval(
[7479042]163pid_t pid,
164struct timespec *interval
[ae68ff0]165);
166@end example
167
168@subheading STATUS CODES:
169
170On error, this routine returns -1 and sets errno to one of the following:
171
172@table @b
173@item ESRCH
[7479042]174The indicated process id is invalid.
175
[ae68ff0]176@item EINVAL
[7479042]177The specified interval pointer parameter is invalid.
[ae68ff0]178
179@end table
180
181@subheading DESCRIPTION:
182
[7479042]183This routine returns the length of the timeslice quantum in the
[e2c8e2c]184@code{interval} parameter for the specified @code{pid}.
185
[ae68ff0]186@subheading NOTES:
187
[e2c8e2c]188The @code{pid} argument should be 0 to indicate the calling process.
189
[7479042]190@c
191@c
192@c
[ae68ff0]193@page
[e2c8e2c]194@subsection sched_yield - Yield the Processor
[ae68ff0]195
[7479042]196@findex sched_yield
197@cindex  yield the processor
198
[ae68ff0]199@subheading CALLING SEQUENCE:
200
201@example
202#include <sched.h>
203
204int sched_yield( void );
205@end example
206
207@subheading STATUS CODES:
208
209This routine always returns zero to indicate success.
210
211@subheading DESCRIPTION:
212
[e2c8e2c]213This call forces the calling thread to yield the processor to another
[7479042]214thread. Normally this is used to implement voluntary round-robin
[e2c8e2c]215task scheduling.
216
[ae68ff0]217@subheading NOTES:
218
[e2c8e2c]219NONE
Note: See TracBrowser for help on using the repository browser.