Chapter

Reliable Systems on Unreliable Networked Platforms

Volume 4322 of the series Lecture Notes in Computer Science pp 143-160

A Concurrency Abstraction for Reliable Sensor Network Applications

  • János SallaiAffiliated withInstitute for Software Integrated Systems, Vanderbilt University, 2015 Terrace Place, Nashville, TN 37203
  • , Miklós MarótiAffiliated withBolyai Institute, University of Szeged, Szeged
  • , Ákos LédecziAffiliated withInstitute for Software Integrated Systems, Vanderbilt University, 2015 Terrace Place, Nashville, TN 37203

* Final gross prices may vary according to local VAT.

Get Access

Abstract

The prevailing paradigm in the regime of resource-constrained embedded devices is event-driven programming. It offers a lightweight yet powerful concurrency model without multiple stacks resulting in reduced memory usage compared to multi-threading. However, event-driven programs need to be implemented as explicit state machines, often with no or limited support from the development tools, resulting in ad-hoc and unstructured code that is error-prone and hard to debug. This paper presents TinyVT, an extension of the nesC language that provides a virtual threading abstraction on top of the event-driven execution model of TinyOS with minimal penalty in memory usage. TinyVT employs a simple continuation mechanism to permit blocking wait, thus allowing split-phase operations within C control structures without relying on multiple stacks. Furthermore, it provides fine-grained scoping of variables shared between event handlers resulting in safer code and allowing for optimizations in compile-time memory allocation. TinyVT source code is mapped to nesC with a source-to-source translator, using synchronous communicating state machines as an intermediate representation.