TOSThreads: Thread-Safe and Non-Invasive Preemption in TinyOS
Kevin Klues, Chieh-Jan Mike Liang, Jeongyeup Paek, Razvan Musaloiu-E., Philip Levis, Andreas Terzis, and Ramesh Govindan
Published in Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems (SenSys), November 2009.
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 TOSThreads, 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 TOSThreads, 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.
Talk (1MB), Paper (327KB)
BibTeX entry
@inproceedings{sensys09klues, author = "Kevin Klues and Chieh-Jan Mike Liang and Jeongyeup Paek and Razvan Musaloiu-E. and Philip Levis and Andreas Terzis and Ramesh Govindan", title = "{TOSThreads: Thread-Safe and Non-Invasive Preemption in TinyOS}", booktitle = "{Proceedings of the 7th ACM Conference on Embedded Networked Sensor Systems (SenSys)}", year = {2009}, month = {November} }