TOSThreads: thread-safe and non-invasive preemption in TinyOS

  • Authors:
  • Kevin Klues;Chieh-Jan Mike Liang;Jeongyeup Paek;Răzvan Musăloiu-E;Philip Levis;Andreas Terzis;Ramesh Govindan

  • Affiliations:
  • UC Berkeley, Berkeley, CA;Johns Hopkins University, Baltimore, MD;University of Southern California, Los Angeles, CA;Johns Hopkins University, Baltimore, MD;Stanford University, Stanford, CA;Johns Hopkins University, Baltimore, MD;University of Southern California, Los Angeles, CA

  • Venue:
  • Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many threads packages have been proposed for programming wireless sensor platforms. However, many sensor network operating systems still choose to provide an event-driven model, due to efficiency concerns. We present TOS-Threads, a threads package for TinyOS that combines the ease of a threaded programming model with the efficiency of an event-based kernel. TOSThreads is backwards compatible with existing TinyOS code, supports an evolvable, thread-safe kernel API, and enables flexible application development through dynamic linking and loading. In TOS-Threads, TinyOS code runs at a higher priority than application threads and all kernel operations are invoked only via message passing, never directly, ensuring thread-safety while enabling maximal concurrency. The TOSThreads package is non-invasive; it does not require any large-scale changes to existing TinyOS code. We demonstrate that TOSThreads context switches and system calls introduce an overhead of less than 0.92% and that dynamic linking and loading takes as little as 90 ms for a representative sensing application. We compare different programming models built using TOSThreads, including standard C with blocking system calls and a reimplementation of Tenet. Additionally, we demonstrate that TOSThreads is able to run computationally intensive tasks without adversely affecting the timing of critical OS services.