Chain: Task-based Programming Model for Intermittent Software
Chain (OOPSLA'16) is a programming model for the intermittent execution model, that arises on intermittently-powered energy-harvesting devices. The programming model is implemented using a set of extensions to the C language with a runtime library, libchain. To write a program using Chain, the application source must include the header and link against the library.
In the Chain programming model, applications are expressed as a graph of
statically-defined tasks with explicit control flow statements that transfer
control from one task to the next. Tasks store local data in variables
allocated on the (volatile) stack and shared data in persisted channels
statically allocated in non-volatile memory. The programming interface
libchain includes macros for declaring tasks and channels,
and for accessing channels from task code. The programming interface
is specified in the
Chain implementation supports MSP430 microcontrollers with FRAM non-volatile memory. Applications written in Chain have been tested on the WISP5 RF-powered device, on the Capybara board, the EDBsat board, and on TI MSP430FRxxxx Launchpads.
Blinker is an example
application written in Chain, which can be used a template to create other
applications. The application is built using
Maker which automatically builds the
libchain dependency when the application is built.