ME405 Library  Version 0.38
Python library in support of ME405 class
cotask.py File Reference

This file contains classes to run cooperatively scheduled tasks in a multitasking system. More...

Classes

class  cotask.Task
 Implements multitasking with scheduling and some performance logging. More...
 
class  cotask.TaskList
 A list of tasks used internally by the task scheduler. More...
 

Variables

 cotask.task_list = TaskList()
 This is the main task list which is created for scheduling when cotask.py is imported into a program.
 

Detailed Description

This file contains classes to run cooperatively scheduled tasks in a multitasking system.

Tasks are created as generators, functions which have infinite loops and call yield at least once in the loop. References to all the tasks to be run in the system are kept in a list maintained by class CoTaskList; the system scheduler then runs the tasks' run() methods according to a chosen scheduling algorithm such as round-robin or highest-priority-first.

Author
JR Ridgely
Date
2017-Jan-01 JRR Approximate date of creation of file
2021-Dec-18 JRR Docstrings modified to work without DoxyPyPy

It is intended for educational use only, but its use is not limited thereto. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.