All Projects → google → dtask

google / dtask

Licence: Apache-2.0 license
DTask is a scheduler for statically dependent tasks.

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dtask

Incubator Nuttx
Apache NuttX is a mature, real-time embedded operating system (RTOS)
Stars: ✭ 591 (+3376.47%)
Mutual labels:  real-time, embedded, rtos
Incubator Nuttx Apps
Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS
Stars: ✭ 65 (+282.35%)
Mutual labels:  real-time, embedded, rtos
Distortos
object-oriented C++ RTOS for microcontrollers
Stars: ✭ 354 (+1982.35%)
Mutual labels:  real-time, embedded, rtos
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (+570.59%)
Mutual labels:  real-time, embedded, rtos
Zephyr
Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
Stars: ✭ 5,335 (+31282.35%)
Mutual labels:  real-time, embedded, rtos
apex
Apex RTOS - A (somewhat) Linux compatible real time operating system
Stars: ✭ 15 (-11.76%)
Mutual labels:  real-time, embedded, rtos
Drone Core
The core crate for Drone, an Embedded Operating System.
Stars: ✭ 263 (+1447.06%)
Mutual labels:  real-time, embedded, rtos
Cocoos
A cooperative operating system based on coroutines
Stars: ✭ 50 (+194.12%)
Mutual labels:  real-time, embedded, rtos
Odas
ODAS: Open embeddeD Audition System
Stars: ✭ 435 (+2458.82%)
Mutual labels:  real-time, embedded
Uc Os3
µC/OS-III is a preemptive, highly portable, and scalable real-time kernel. Designed for ease of use on a huge number of CPU architectures.
Stars: ✭ 284 (+1570.59%)
Mutual labels:  real-time, rtos
Fprime
F' - A flight software and embedded systems framework
Stars: ✭ 8,642 (+50735.29%)
Mutual labels:  real-time, embedded
phoenix-rtos-kernel
Phoenix-RTOS microkernel repository
Stars: ✭ 77 (+352.94%)
Mutual labels:  real-time, rtos
Prettyos
A Preemptive Hard Real Time kernel for embedded devices.
Stars: ✭ 36 (+111.76%)
Mutual labels:  real-time, rtos
Erika3
ERIKA Enterprise v3 RTOS
Stars: ✭ 98 (+476.47%)
Mutual labels:  real-time, rtos
Fastmot
High-performance multiple object tracking based on YOLO, Deep SORT, and optical flow
Stars: ✭ 284 (+1570.59%)
Mutual labels:  real-time, embedded
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+8488.24%)
Mutual labels:  real-time, embedded
Uc Os2
µC/OS-II is a preemptive, highly portable, and scalable real-time kernels. Designed for ease of use on a huge number of CPU architectures.
Stars: ✭ 120 (+605.88%)
Mutual labels:  real-time, rtos
o1heap
Constant-complexity deterministic memory allocator (heap) for hard real-time high-integrity embedded systems
Stars: ✭ 119 (+600%)
Mutual labels:  real-time, embedded
Embedded UKF Library
A compact Unscented Kalman Filter (UKF) library for Teensy4/Arduino system (or any real time embedded system in general)
Stars: ✭ 31 (+82.35%)
Mutual labels:  real-time, embedded
Rtmlton
MLton with Realtime GC and Threading features
Stars: ✭ 98 (+476.47%)
Mutual labels:  real-time, frp

DTask

DTask is a scheduler for statically dependent tasks.

Many embedded sensor applications can be structured as a set of dependent computations starting from an interrupt. Intermediate computations may be shared, such as filtered data. This is a type of data flow programming. DTask is designed to make this easy to express, and yet require minimal resources. DTask could replace an RTOS in some situations, and is much less complicated.

DTask uses annotations in the source code to calculate task dependencies during compilation, and then sorts them topologically. At runtime, the task are processed in waves, so that results can be passed atomically without locking. Tasks can be enabled and disabled at runtime, which will automatically enable/disable other related tasks.

DTask allows definition of many small modular tasks that will be easier to test, and yet can be inlined for performance.

This is not an official Google product.

Usage

Declare a task like this:

DTASK(task_name, result_type)
{
  bool z_is_valid;
  result_type z;

  int x = *DREF(an_integer);
  int y = *DREF(another_integer);
  // compute z from x and y, set z_is_valid if the computation yields a (new/valid) result
  if(z_is_valid) {
    task_name = z;
  }
  return z_is_valid;
}

Code can be added to run when the task is enabled or disabled:

DTASK_ENABLE(task_name)
{
  // run when task_name is enabled
}

DTASK_DISABLE(task_name)
{
  // run when task_name is disabled
}

Tasks are declared in groups. A task group is declared with:

DTASK_GROUP(group_name)

The following tasks are part of this group. This will create a struct type that contains the state named group_name_state, which contains a field for every task.

API

Outside of a task (or from another task group, see below):

  • dtask_enable(state, TASK1 | TASK2): Enable TASK1 and TASK2 (and dependencies)
  • dtask_disable(state, TASK1 | TASK2): Disable TASK1 and TASK2 (and dependents)
  • dtask_clear(state, TASK1 | TASK2): Only enable TASK1 and TASK2 if enabled tasks depend on them
  • dtask_switch(state, TASK1 | TASK2): Enable only TASK1 and TASK2 and depencencies, disable all others
  • dtask_select(state): commit the changes from the above calls, and run DTASK_ENABLE/DTASK_DISABLE code for tasks that are enabled/disabled.
  • dtask_run(state, INITIAL_TASK): run tasks, running the task named initial unconditionally.

And within a task:

  • to get a value: x = *DREF(task_name);
  • to set the result of a task: *DREF(task_name) = x;
    • task_name should be the name of the current task only.

See main.c, and *_tasks.c for an example. Run make && ./test to build and run the example.

Delays

Delays can be used to look at the history of a value, useful to implement FIR filters for example.

Use DELAY(type, length) as a task type to implement a delay. Then use the following API:

  • DELAY_READ(delay, type, len, i): returns a pointer to the value i waves ago
  • DELAY_WRITE(delay, type, len, value): writes the value for the current wave
  • DELAY_FILL(delay, type, len, value): fills the delay with a value

The delay must be declared with DECLARE_DELAY(type, length).

See factor_tasks.c for an example.

Nesting

Task groups can be nested by calling dtask_run() from a task in another task group.

See toplevel_tasks.c for an example.

MSP430 Lauchpad Pump Demo

Click below for a video of the pump controller demo in operation:

Pump Demo Video

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].