source: rtems-docs/c-user/scheduling_concepts.rst @ 9037998

5
Last change on this file since 9037998 was 9037998, checked in by Sebastian Huber <sebastian.huber@…>, on 07/07/17 at 13:50:51

c-user: Update scheduler/task chapter

Reflect EDF SMP scheduler changes.

Close #3059.
Close #3063.

  • Property mode set to 100644
File size: 27.6 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. COMMENT: COPYRIGHT (c) 1988-2008.
4.. COMMENT: On-Line Applications Research Corporation (OAR).
5.. COMMENT: All rights reserved.
6
7Scheduling Concepts
8*******************
9
10.. index:: scheduling
11.. index:: task scheduling
12
13Introduction
14============
15
16The concept of scheduling in real-time systems dictates the ability to provide
17immediate response to specific external events, particularly the necessity of
18scheduling tasks to run within a specified time limit after the occurrence of
19an event.  For example, software embedded in life-support systems used to
20monitor hospital patients must take instant action if a change in the patient's
21status is detected.
22
23The component of RTEMS responsible for providing this capability is
24appropriately called the scheduler.  The scheduler's sole purpose is to
25allocate the all important resource of processor time to the various tasks
26competing for attention.
27
28The directives provided by the scheduler manager are:
29
30- rtems_scheduler_ident_ - Get ID of a scheduler
31
32- rtems_scheduler_get_processor_set_ - Get processor set of a scheduler
33
34- rtems_scheduler_add_processor_ - Add processor to a scheduler
35
36- rtems_scheduler_remove_processor_ - Remove processor from a scheduler
37
38Scheduling Algorithms
39---------------------
40
41.. index:: scheduling algorithms
42
43RTEMS provides a plugin framework which allows it to support multiple
44scheduling algorithms. RTEMS includes multiple scheduling algorithms and the
45user can select which of these they wish to use in their application at
46link-time.  In addition, the user can implement their own scheduling algorithm
47and configure RTEMS to use it.
48
49Supporting multiple scheduling algorithms gives the end user the option to
50select the algorithm which is most appropriate to their use case. Most
51real-time operating systems schedule tasks using a priority based algorithm,
52possibly with preemption control.  The classic RTEMS scheduling algorithm which
53was the only algorithm available in RTEMS 4.10 and earlier, is a fixed-priority
54scheduling algorithm.  This scheduling algoritm is suitable for uniprocessor
55(e.g. non-SMP) systems and is known as the *Deterministic Priority
56Scheduler*.  Unless the user configures another scheduling algorithm, RTEMS
57will use this on uniprocessor systems.
58
59Priority Scheduling
60-------------------
61.. index:: priority scheduling
62
63When using priority based scheduling, RTEMS allocates the processor using a
64priority-based, preemptive algorithm augmented to provide round-robin
65characteristics within individual priority groups.  The goal of this algorithm
66is to guarantee that the task which is executing on the processor at any point
67in time is the one with the highest priority among all tasks in the ready
68state.
69
70When a task is added to the ready chain, it is placed behind all other tasks of
71the same priority.  This rule provides a round-robin within priority group
72scheduling characteristic.  This means that in a group of equal priority tasks,
73tasks will execute in the order they become ready or FIFO order.  Even though
74there are ways to manipulate and adjust task priorities, the most important
75rule to remember is:
76
77.. note::
78
79  Priority based scheduling algorithms will always select the highest priority
80  task that is ready to run when allocating the processor to a task.
81
82Priority scheduling is the most commonly used scheduling algorithm.  It should
83be used by applications in which multiple tasks contend for CPU time or other
84resources and there is a need to ensure certain tasks are given priority over
85other tasks.
86
87There are a few common methods of accomplishing the mechanics of this
88algorithm.  These ways involve a list or chain of tasks in the ready state.
89
90- The least efficient method is to randomly place tasks in the ready chain
91  forcing the scheduler to scan the entire chain to determine which task
92  receives the processor.
93
94- A more efficient method is to schedule the task by placing it in the proper
95  place on the ready chain based on the designated scheduling criteria at the
96  time it enters the ready state.  Thus, when the processor is free, the first
97  task on the ready chain is allocated the processor.
98
99- Another mechanism is to maintain a list of FIFOs per priority.  When a task
100  is readied, it is placed on the rear of the FIFO for its priority.  This
101  method is often used with a bitmap to assist in locating which FIFOs have
102  ready tasks on them.  This data structure has :math:`O(1)` insert, extract
103  and find highest ready run-time complexities.
104
105- A red-black tree may be used for the ready queue with the priority as the
106  key.  This data structure has :math:`O(log(n))` insert, extract and find
107  highest ready run-time complexities while :math:`n` is the count of tasks in
108  the ready queue.
109
110RTEMS currently includes multiple priority based scheduling algorithms as well
111as other algorithms which incorporate deadline.  Each algorithm is discussed in
112the following sections.
113
114Uniprocessor Schedulers
115=======================
116
117All uniprocessor schedulers included in RTEMS are priority based.  The
118processor is allocated to the highest priority task allowed to run.
119
120Deterministic Priority Scheduler
121--------------------------------
122
123This is the scheduler implementation which has always been in RTEMS.  After the
1244.10 release series, it was factored into pluggable scheduler selection.  It
125schedules tasks using a priority based algorithm which takes into account
126preemption.  It is implemented using an array of FIFOs with a FIFO per
127priority.  It maintains a bitmap which is used to track which priorities have
128ready tasks.
129
130This algorithm is deterministic (e.g. predictable and fixed) in execution time.
131This comes at the cost of using slightly over three (3) kilobytes of RAM on a
132system configured to support 256 priority levels.
133
134This scheduler is only aware of a single core.
135
136Simple Priority Scheduler
137-------------------------
138
139This scheduler implementation has the same behaviour as the Deterministic
140Priority Scheduler but uses only one linked list to manage all ready tasks.
141When a task is readied, a linear search of that linked list is performed to
142determine where to insert the newly readied task.
143
144This algorithm uses much less RAM than the Deterministic Priority Scheduler but
145is *O(n)* where *n* is the number of ready tasks.  In a small system with a
146small number of tasks, this will not be a performance issue.  Reducing RAM
147consumption is often critical in small systems which are incapable of
148supporting a large number of tasks.
149
150This scheduler is only aware of a single core.
151
152Earliest Deadline First Scheduler
153---------------------------------
154.. index:: earliest deadline first scheduling
155
156This is an alternative scheduler in RTEMS for single core applications.  The
157primary EDF advantage is high total CPU utilization (theoretically up to
158100%). It assumes that tasks have priorities equal to deadlines.
159
160This EDF is initially preemptive, however, individual tasks may be declared
161not-preemptive. Deadlines are declared using only Rate Monotonic manager which
162goal is to handle periodic behavior. Period is always equal to deadline. All
163ready tasks reside in a single ready queue implemented using a red-black tree.
164
165This implementation of EDF schedules two different types of task priority types
166while each task may switch between the two types within its execution. If a
167task does have a deadline declared using the Rate Monotonic manager, the task
168is deadline-driven and its priority is equal to deadline.  On the contrary if a
169task does not have any deadline or the deadline is cancelled using the Rate
170Monotonic manager, the task is considered a background task with priority equal
171to that assigned upon initialization in the same manner as for priority
172scheduler. Each background task is of a lower importance than each
173deadline-driven one and is scheduled when no deadline-driven task and no higher
174priority background task is ready to run.
175
176Every deadline-driven scheduling algorithm requires means for tasks to claim a
177deadline.  The Rate Monotonic Manager is responsible for handling periodic
178execution. In RTEMS periods are equal to deadlines, thus if a task announces a
179period, it has to be finished until the end of this period. The call of
180``rtems_rate_monotonic_period`` passes the scheduler the length of oncoming
181deadline. Moreover, the ``rtems_rate_monotonic_cancel`` and
182``rtems_rate_monotonic_delete`` calls clear the deadlines assigned to the task.
183
184Constant Bandwidth Server Scheduling (CBS)
185------------------------------------------
186.. index:: constant bandwidth server scheduling
187
188This is an alternative scheduler in RTEMS for single core applications.  The
189CBS is a budget aware extension of EDF scheduler. The main goal of this
190scheduler is to ensure temporal isolation of tasks meaning that a task's
191execution in terms of meeting deadlines must not be influenced by other tasks
192as if they were run on multiple independent processors.
193
194Each task can be assigned a server (current implementation supports only one
195task per server). The server is characterized by period (deadline) and
196computation time (budget). The ratio budget/period yields bandwidth, which is
197the fraction of CPU to be reserved by the scheduler for each subsequent period.
198
199The CBS is equipped with a set of rules applied to tasks attached to servers
200ensuring that deadline miss because of another task cannot occur.  In case a
201task breaks one of the rules, its priority is pulled to background until the
202end of its period and then restored again. The rules are:
203
204- Task cannot exceed its registered budget,
205
206- Task cannot be unblocked when a ratio between remaining budget and remaining
207  deadline is higher than declared bandwidth.
208
209The CBS provides an extensive API. Unlike EDF, the
210``rtems_rate_monotonic_period`` does not declare a deadline because it is
211carried out using CBS API. This call only announces next period.
212
213SMP Schedulers
214==============
215
216All SMP schedulers included in RTEMS are priority based.  The processors
217managed by a scheduler instance are allocated to the highest priority tasks
218allowed to run.
219
220Earliest Deadline First SMP Scheduler
221-------------------------------------
222
223A job-level fixed-priority scheduler using the Earliest Deadline First (EDF)
224method.  By convention, the maximum priority level is
225:math:`min(INT\_MAX, 2^{63} - 1)` for background tasks.  The tasks with an
226active deadline have a higher priority than the background tasks.  This
227scheduler supports task processor affinities of one-to-one and one-to-all, e.g.
228a task can execute on exactly one processor or all processors managed by the
229scheduler instance.  This is the default scheduler in SMP configurations if
230more than one processor is configured.  The processor affinity set of a task
231must contain all online processors to select the one-to-all affinity.  This is
232to avoid pathological cases if processors are added/removed to/from the
233scheduler instance at run-time.  In case the processor affinity set contains
234not all online processors, then a one-to-one affinity will be used selecting
235the processor with the largest index within the set of processores currently
236owned by the scheduler instance.
237
238Deterministic Priority SMP Scheduler
239------------------------------------
240
241A fixed-priority scheduler which uses a table of chains with one chain per
242priority level for the ready tasks.  The maximum priority level is
243configurable.  By default, the maximum priority level is 255 (256 priority
244levels).
245
246Simple Priority SMP Scheduler
247-----------------------------
248
249A fixed-priority scheduler which uses a sorted chain for the ready tasks.  By
250convention, the maximum priority level is 255.  The implementation limit is
251actually :math:`2^{64} - 1`.
252
253Aribitary Processor Affinity Priority SMP Scheduler
254---------------------------------------------------
255
256A fixed-priority scheduler which uses a table of chains with one chain per
257priority level for the ready tasks.  The maximum priority level is
258configurable.  By default, the maximum priority level is 255 (256 priority
259levels).  This scheduler supports arbitrary task processor affinities.  The
260worst-case run-time complexity of some scheduler operations exceeds
261:math:`O(n)` while :math:`n` is the count of ready tasks.
262
263Scheduling Modification Mechanisms
264==================================
265
266.. index:: scheduling mechanisms
267
268RTEMS provides four mechanisms which allow the user to alter the task
269scheduling decisions:
270
271- user-selectable task priority level
272
273- task preemption control
274
275- task timeslicing control
276
277- manual round-robin selection
278
279Each of these methods provides a powerful capability to customize sets of tasks
280to satisfy the unique and particular requirements encountered in custom
281real-time applications.  Although each mechanism operates independently, there
282is a precedence relationship which governs the effects of scheduling
283modifications.  The evaluation order for scheduling characteristics is always
284priority, preemption mode, and timeslicing.  When reading the descriptions of
285timeslicing and manual round-robin it is important to keep in mind that
286preemption (if enabled) of a task by higher priority tasks will occur as
287required, overriding the other factors presented in the description.
288
289Task Priority and Scheduling
290----------------------------
291.. index:: task priority
292
293The most significant task scheduling modification mechanism is the ability for
294the user to assign a priority level to each individual task when it is created
295and to alter a task's priority at run-time.  The maximum priority level depends
296on the configured scheduler.  A lower priority level means higher priority
297(higher importance).  The maximum priority level of the default uniprocessor
298scheduler is 255.
299
300Preemption
301----------
302.. index:: preemption
303
304Another way the user can alter the basic scheduling algorithm is by
305manipulating the preemption mode flag (``RTEMS_PREEMPT_MASK``) of individual
306tasks.  If preemption is disabled for a task (``RTEMS_NO_PREEMPT``), then the
307task will not relinquish control of the processor until it terminates, blocks,
308or re-enables preemption.  Even tasks which become ready to run and possess
309higher priority levels will not be allowed to execute.  Note that the
310preemption setting has no effect on the manner in which a task is scheduled.
311It only applies once a task has control of the processor.
312
313Timeslicing
314-----------
315.. index:: timeslicing
316.. index:: round robin scheduling
317
318Timeslicing or round-robin scheduling is an additional method which can be used
319to alter the basic scheduling algorithm.  Like preemption, timeslicing is
320specified on a task by task basis using the timeslicing mode flag
321(``RTEMS_TIMESLICE_MASK``).  If timeslicing is enabled for a task
322(``RTEMS_TIMESLICE``), then RTEMS will limit the amount of time the task can
323execute before the processor is allocated to another task.  Each tick of the
324real-time clock reduces the currently running task's timeslice.  When the
325execution time equals the timeslice, RTEMS will dispatch another task of the
326same priority to execute.  If there are no other tasks of the same priority
327ready to execute, then the current task is allocated an additional timeslice
328and continues to run.  Remember that a higher priority task will preempt the
329task (unless preemption is disabled) as soon as it is ready to run, even if the
330task has not used up its entire timeslice.
331
332Manual Round-Robin
333------------------
334.. index:: manual round robin
335
336The final mechanism for altering the RTEMS scheduling algorithm is called
337manual round-robin.  Manual round-robin is invoked by using
338the ``rtems_task_wake_after`` directive with a time interval of
339``RTEMS_YIELD_PROCESSOR``.  This allows a task to give up the processor and be
340immediately returned to the ready chain at the end of its priority group.  If
341no other tasks of the same priority are ready to run, then the task does not
342lose control of the processor.
343
344Dispatching Tasks
345=================
346.. index:: dispatching
347
348The dispatcher is the RTEMS component responsible for allocating the processor
349to a ready task.  In order to allocate the processor to one task, it must be
350deallocated or retrieved from the task currently using it.  This involves a
351concept called a context switch.  To perform a context switch, the dispatcher
352saves the context of the current task and restores the context of the task
353which has been allocated to the processor.  Saving and restoring a task's
354context is the storing/loading of all the essential information about a task to
355enable it to continue execution without any effects of the interruption.  For
356example, the contents of a task's register set must be the same when it is
357given the processor as they were when it was taken away.  All of the
358information that must be saved or restored for a context switch is located
359either in the TCB or on the task's stacks.
360
361Tasks that utilize a numeric coprocessor and are created with the
362``RTEMS_FLOATING_POINT`` attribute require additional operations during a
363context switch.  These additional operations are necessary to save and restore
364the floating point context of ``RTEMS_FLOATING_POINT`` tasks.  To avoid
365unnecessary save and restore operations, the state of the numeric coprocessor
366is only saved when a ``RTEMS_FLOATING_POINT`` task is dispatched and that task
367was not the last task to utilize the coprocessor.
368
369Task State Transitions
370======================
371.. index:: task state transitions
372
373Tasks in an RTEMS system must always be in one of the five allowable task
374states.  These states are: executing, ready, blocked, dormant, and
375non-existent.
376
377A task occupies the non-existent state before a ``rtems_task_create`` has been
378issued on its behalf.  A task enters the non-existent state from any other
379state in the system when it is deleted with the ``rtems_task_delete``
380directive.  While a task occupies this state it does not have a TCB or a task
381ID assigned to it; therefore, no other tasks in the system may reference this
382task.
383
384When a task is created via the ``rtems_task_create`` directive it enters the
385dormant state.  This state is not entered through any other means.  Although
386the task exists in the system, it cannot actively compete for system resources.
387It will remain in the dormant state until it is started via the
388``rtems_task_start`` directive, at which time it enters the ready state.  The
389task is now permitted to be scheduled for the processor and to compete for
390other system resources.
391
392.. figure:: ../images/c_user/states.png
393         :width: 70%
394         :align: center
395         :alt: Task State Transitions
396
397A task occupies the blocked state whenever it is unable to be scheduled to run.
398A running task may block itself or be blocked by other tasks in the system.
399The running task blocks itself through voluntary operations that cause the task
400to wait.  The only way a task can block a task other than itself is with the
401``rtems_task_suspend`` directive.  A task enters the blocked state due to any
402of the following conditions:
403
404- A task issues a ``rtems_task_suspend`` directive which blocks either itself
405  or another task in the system.
406
407- The running task issues a ``rtems_barrier_wait`` directive.
408
409- The running task issues a ``rtems_message_queue_receive`` directive with the
410  wait option and the message queue is empty.
411
412- The running task issues an ``rtems_event_receive`` directive with the wait
413  option and the currently pending events do not satisfy the request.
414
415- The running task issues a ``rtems_semaphore_obtain`` directive with the wait
416  option and the requested semaphore is unavailable.
417
418- The running task issues a ``rtems_task_wake_after`` directive which blocks
419  the task for the given time interval.  If the time interval specified is
420  zero, the task yields the processor and remains in the ready state.
421
422- The running task issues a ``rtems_task_wake_when`` directive which blocks the
423  task until the requested date and time arrives.
424
425- The running task issues a ``rtems_rate_monotonic_period`` directive and must
426  wait for the specified rate monotonic period to conclude.
427
428- The running task issues a ``rtems_region_get_segment`` directive with the
429  wait option and there is not an available segment large enough to satisfy the
430  task's request.
431
432A blocked task may also be suspended.  Therefore, both the suspension and the
433blocking condition must be removed before the task becomes ready to run again.
434
435A task occupies the ready state when it is able to be scheduled to run, but
436currently does not have control of the processor.  Tasks of the same or higher
437priority will yield the processor by either becoming blocked, completing their
438timeslice, or being deleted.  All tasks with the same priority will execute in
439FIFO order.  A task enters the ready state due to any of the following
440conditions:
441
442- A running task issues a ``rtems_task_resume`` directive for a task that is
443  suspended and the task is not blocked waiting on any resource.
444
445- A running task issues a ``rtems_message_queue_send``,
446  ``rtems_message_queue_broadcast``, or a ``rtems_message_queue_urgent``
447  directive which posts a message to the queue on which the blocked task is
448  waiting.
449
450- A running task issues an ``rtems_event_send`` directive which sends an event
451  condition to a task which is blocked waiting on that event condition.
452
453- A running task issues a ``rtems_semaphore_release`` directive which releases
454  the semaphore on which the blocked task is waiting.
455
456- A timeout interval expires for a task which was blocked by a call to the
457  ``rtems_task_wake_after`` directive.
458
459- A timeout period expires for a task which blocked by a call to the
460  ``rtems_task_wake_when`` directive.
461
462- A running task issues a ``rtems_region_return_segment`` directive which
463  releases a segment to the region on which the blocked task is waiting and a
464  resulting segment is large enough to satisfy the task's request.
465
466- A rate monotonic period expires for a task which blocked by a call to the
467  ``rtems_rate_monotonic_period`` directive.
468
469- A timeout interval expires for a task which was blocked waiting on a message,
470  event, semaphore, or segment with a timeout specified.
471
472- A running task issues a directive which deletes a message queue, a semaphore,
473  or a region on which the blocked task is waiting.
474
475- A running task issues a ``rtems_task_restart`` directive for the blocked
476  task.
477
478- The running task, with its preemption mode enabled, may be made ready by
479  issuing any of the directives that may unblock a task with a higher priority.
480  This directive may be issued from the running task itself or from an ISR.  A
481  ready task occupies the executing state when it has control of the CPU.  A
482  task enters the executing state due to any of the following conditions:
483
484- The task is the highest priority ready task in the system.
485
486- The running task blocks and the task is next in the scheduling queue.  The
487  task may be of equal priority as in round-robin scheduling or the task may
488  possess the highest priority of the remaining ready tasks.
489
490- The running task may reenable its preemption mode and a task exists in the
491  ready queue that has a higher priority than the running task.
492
493- The running task lowers its own priority and another task is of higher
494  priority as a result.
495
496- The running task raises the priority of a task above its own and the running
497  task is in preemption mode.
498
499Directives
500==========
501
502This section details the scheduler manager.  A subsection is dedicated to each
503of these services and describes the calling sequence, related constants, usage,
504and status codes.
505
506.. raw:: latex
507
508   \clearpage
509
510.. _rtems_scheduler_ident:
511
512SCHEDULER_IDENT - Get ID of a scheduler
513---------------------------------------
514
515CALLING SEQUENCE:
516    .. code-block:: c
517
518        rtems_status_code rtems_scheduler_ident(
519            rtems_name  name,
520            rtems_id   *id
521        );
522
523DIRECTIVE STATUS CODES:
524    .. list-table::
525     :class: rtems-table
526
527     * - ``RTEMS_SUCCESSFUL``
528       - Successful operation.
529     * - ``RTEMS_INVALID_ADDRESS``
530       - The ``id`` parameter is ``NULL``.
531     * - ``RTEMS_INVALID_NAME``
532       - Invalid scheduler name.
533
534DESCRIPTION:
535    Identifies a scheduler by its name.  The scheduler name is determined by
536    the scheduler configuration.  See :ref:`Configuring Clustered Schedulers`
537    and :ref:`Configuring a Scheduler Name`.
538
539NOTES:
540    None.
541
542.. raw:: latex
543
544   \clearpage
545
546.. _rtems_scheduler_get_processor_set:
547
548SCHEDULER_GET_PROCESSOR_SET - Get processor set of a scheduler
549--------------------------------------------------------------
550
551CALLING SEQUENCE:
552    .. code-block:: c
553
554        rtems_status_code rtems_scheduler_get_processor_set(
555            rtems_id   scheduler_id,
556            size_t     cpusetsize,
557            cpu_set_t *cpuset
558        );
559
560DIRECTIVE STATUS CODES:
561    .. list-table::
562     :class: rtems-table
563
564     * - ``RTEMS_SUCCESSFUL``
565       - Successful operation.
566     * - ``RTEMS_INVALID_ID``
567       - Invalid scheduler instance identifier.
568     * - ``RTEMS_INVALID_ADDRESS``
569       - The ``cpuset`` parameter is ``NULL``.
570     * - ``RTEMS_INVALID_NUMBER``
571       - The processor set buffer is too small for the set of processors owned
572         by the scheduler instance.
573
574DESCRIPTION:
575    Returns the processor set owned by the scheduler instance in ``cpuset``.  A
576    set bit in the processor set means that this processor is owned by the
577    scheduler instance and a cleared bit means the opposite.
578
579NOTES:
580    None.
581
582.. raw:: latex
583
584   \clearpage
585
586.. _rtems_scheduler_add_processor:
587
588SCHEDULER_ADD_PROCESSOR - Add processor to a scheduler
589------------------------------------------------------
590
591CALLING SEQUENCE:
592    .. code-block:: c
593
594        rtems_status_code rtems_scheduler_add_processor(
595            rtems_id scheduler_id,
596            uint32_t cpu_index
597        );
598
599DIRECTIVE STATUS CODES:
600    .. list-table::
601     :class: rtems-table
602
603     * - ``RTEMS_SUCCESSFUL``
604       - Successful operation.
605     * - ``RTEMS_INVALID_ID``
606       - Invalid scheduler instance identifier.
607     * - ``RTEMS_NOT_CONFIGURED``
608       - The processor is not configured to be used by the application.
609     * - ``RTEMS_INCORRECT_STATE``
610       - The processor is configured to be used by the application, however, it
611         is not online.
612     * - ``RTEMS_RESOURCE_IN_USE``
613       - The processor is already assigned to a scheduler instance.
614
615DESCRIPTION:
616    Adds a processor to the set of processors owned by the specified scheduler
617    instance.
618
619NOTES:
620    Must be called from task context.  This operation obtains and releases the
621    objects allocator lock.
622
623.. raw:: latex
624
625   \clearpage
626
627.. _rtems_scheduler_remove_processor:
628
629SCHEDULER_REMOVE_PROCESSOR - Remove processor from a scheduler
630--------------------------------------------------------------
631
632CALLING SEQUENCE:
633    .. code-block:: c
634
635        rtems_status_code rtems_scheduler_remove_processor(
636            rtems_id scheduler_id,
637            uint32_t cpu_index
638        );
639
640DIRECTIVE STATUS CODES:
641    .. list-table::
642     :class: rtems-table
643
644     * - ``RTEMS_SUCCESSFUL``
645       - Successful operation.
646     * - ``RTEMS_INVALID_ID``
647       - Invalid scheduler instance identifier.
648     * - ``RTEMS_INVALID_NUMBER``
649       - The processor is not owned by the specified scheduler instance.
650     * - ``RTEMS_RESOURCE_IN_USE``
651       - The set of processors owned by the specified scheduler instance would
652         be empty after the processor removal and there exists a non-idle task
653         that uses this scheduler instance as its home scheduler instance.
654     * - ``RTEMS_RESOURCE_IN_USE``
655       - A task with a restricted processor affinity exists that uses this
656         scheduler instance as its home scheduler instance and it would be no
657         longer possible to allocate a processor for this task after the
658         removal of this processor.
659
660DESCRIPTION:
661    Removes a processor from set of processors owned by the specified scheduler
662    instance.
663
664NOTES:
665    Must be called from task context.  This operation obtains and releases the
666    objects allocator lock.  Removing a processor from a scheduler is a complex
667    operation that involves all tasks of the system.
Note: See TracBrowser for help on using the repository browser.