|
ME 405 Romi
|
A list of tasks used internally by the task scheduler. More...
Public Member Functions | |
| __init__ (self) | |
| Initialize the task list. | |
| append (self, task) | |
| Append a task to the task list. | |
| rr_sched (self) | |
| Run tasks in order, ignoring the tasks' priorities. | |
| pri_sched (self) | |
| Run tasks according to their priorities. | |
| __repr__ (self) | |
| Create some diagnostic text showing the tasks in the task list. | |
Public Attributes | |
| list | pri_list = [] |
| The list of priority lists. | |
A list of tasks used internally by the task scheduler.
This class holds the list of tasks which will be run by the task scheduler. The task list is usually not directly used by the programmer except when tasks are added to it and the scheduler is called. An example showing the use of the task list is given in the last few lines of the documentation for class Task.
The task list is sorted by priority so that the scheduler can efficiently look through the list to find the highest priority task which is ready to run at any given time. Tasks can also be scheduled in a simpler "round-robin" fashion.
| cotask.TaskList.__init__ | ( | self | ) |
| cotask.TaskList.__repr__ | ( | self | ) |
| cotask.TaskList.append | ( | self, | |
| task ) |
Append a task to the task list.
The list will be sorted by task priorities so that the scheduler can quickly find the highest priority task which is ready to run at any given time.
| task | The task to be appended to the list |
Definition at line 316 of file cotask.py.


| cotask.TaskList.pri_sched | ( | self | ) |
| cotask.TaskList.rr_sched | ( | self | ) |
Run tasks in order, ignoring the tasks' priorities.
This scheduling method runs tasks in a round-robin fashion. Each time it is called, it goes through the list of tasks and gives each of them a chance to run. Although this scheduler first runs higher priority tasks first, that has no significant effect in the long run, as all the tasks are given a chance to run each time through the list, and it takes about the same amount of time before each is given a chance to run again.
| list cotask.TaskList.pri_list = [] |