Skip to content

Creating TaskScheduler friendly libraries

Anatoli Arkhipenko edited this page Jan 12, 2018 · 17 revisions

Types of libraries

From the task scheduling perspective all libraries fall into two major categories:

  • Single-operation oriented
  • Repetitive process oriented Single operations oriented libraries are those that do something (or multiple things) once, and then exit (return a value, an array, etc.). There is no internal scheduling required, although some pre-defined sequence of actions is needed, and there could be certain delays necessary due to hardware timing, etc. Example: libraries to read sensor values. Repetitive process oriented libraries do something many times on behalf of the developer in a transparent manner. Those need internal scheduling to perform actions periodically or continuously in the background. Example: mesh network libraries.

Typical issues

Single operations oriented libraries deal with I/O (hardware, telecommunications, measurements) very frequently require delays to "wait" for events, data, hardware to become ready, etc. Those libraries are often implemented in a synchronous way, i.e., the whole processing stops until library finishes processing, while in many cases, library is just waiting for something to happen. Repetitive process oriented libraries often implement their own scheduling mechanism which is embedded and hidden from the developers, and does not play weel with external schedulers, like TaskScheduler.

How to re-write a library in a TaskScheduler-fiendly way

Single operations oriented libraries

to be continued

Repetitive process oriented libraries

to be continued

Clone this wiki locally