Timeslicing or round-robin scheduling is an
additional method which can be used to alter the basic
scheduling algorithm. Like preemption, timeslicing is specified
on a task by task basis using the timeslicing mode flag
(RTEMS_TIMESLICE_MASK
). If timeslicing is enabled for a task
(RTEMS_TIMESLICE
), then RTEMS will limit the amount of time the task
can execute before the processor is allocated to another task.
Each tick of the real-time clock reduces the currently running
task's timeslice. When the execution time equals the timeslice,
RTEMS will dispatch another task of the same priority to
execute. If there are no other tasks of the same priority ready
to execute, then the current task is allocated an additional
timeslice and continues to run. Remember that a higher priority
task will preempt the task (unless preemption is disabled) as
soon as it is ready to run, even if the task has not used up its
entire timeslice.
Copyright © 1988-2007OAR Corporation