TaskManagerIO provides scheduling, events and interrupt marshalling, all while remaining thread safe across a wide range of boards. By thread safe we mean that you can add tasks to task manager from another thread while it's still running. However, the task manager itself will always run on one thread, making it easy for you to write code.
This library contains the original scheduling support class TaskManager that was previously built into IoAbstraction.
Task manager can schedule tasks to be done either now, or at some point in the future. Available in all versions of task manager.
Task Manager can add an interrupt on your behalf that is marshalled into a task execution. Available in all versions of task manager.
TaskManagerIO has a complete eventing framework built into it, on top of this many types of event based programs can be built.
If you are using an RTOS such as FreeRTOS on ESP32 or mbed RTOS 6 you can safely add tasks and trigger events from other threads. However, you should never run the run loop from more than one thread at a time. You can however, start another task-manager on another thread.
Remember that one of TaskManagerIO's main advantages is that your embedded apps don't need to be concerned with the possibility of access across more than one thread, or working out how to handle raw interrupt handlers. Removing these from the mix allows code to be cleaner.
In this guide we assume that you are familiar with the API for scheduling tasks on task manager. Let's first discuss what we consider an event to be, and what it means to be an interrupt or threaded event. Interrupt or threaded events are subject to external actors (such as threads or interrupts). In this case the event will invariably be...
In this guide we assume that you are familiar with the API for scheduling tasks on task manager. Let's first discuss what we consider an event to be, and what it means to be a polled event. By polling we mean no external actors (such as threads or interrupts) are involved. Task manager will ask your event instance frequently if it...
Using TaskManager in your sketches TaskManager is a very simple co-operative coroutines / executor framework that allows work to be scheduled in an internal queue. Instead of writing code using delays, one simply adds jobs to be done at some point in the future. In addition to this, interrupt handling is also supported, such that the interrupt is "marshalled" and handled...
There are often cases when you'll need to run a micro controller from a battery power source. Unlike when running from mains power, every milli-amp matters. In these cases IoAbstraction's task manager is able to integrate easily with most low power libraries. Task manager works by repeatedly calling the function within or , during each loop task manager evaluates...
In this tutorial for TaskManagerIO I explain the differences between traditional loop based programming; which is very common on the Arduino platform and event based programming based on taskManager. Although event based programming looks slightly more complicated at first, as the sketch and surrounding code gets more complex, eventing will scale to that much easier. Eventing task frameworks make ongoing maintenance...
Task Manager supports the concept of Spin Locks to protect sensitive asynchronous operations from becoming interleaved. For example, to protect sensitive blocks of code. Be very aware that this does not include a memory barrier. A spin lock loops waiting for the lock to become available, you can either spin for a period of time, or until the lock is...
Moved, see [arduino-libraries.md] for the list.
Interrupt handling is generally an advanced topic, but this library provides a very simple way to handle interrupts. There are two ways to handle interrupts in TaskManagerIO, the first is by marshalling, and the second is by writing an event. We recommend that all new code uses the event method to handle interrupts , although we have no plans to deprecate...