Event-driven programs, while especially suited for running on low-power and low-resource devices such as wireless sensor nodes, are difficult to write. It takes a shift in mindset on the part of the programmer to embrace the event-driven style. Multi-threaded programs, on the other hand, are more natural and easier to write. However, the typical problem with multi-threading is that it has a negative impact on performance and on memory consumption, which is a scarce resource to begin with on these nodes.
The goal of this project is to enable programmers to write multi-threaded programs that preserve the semantics of threads, while at the same time executing efficiently on the mote hardware. We chose TinyOS/nesC as our target platform given the popularity of the platform, and built a library solution to allow for the construction of multi-threaded programs.
This library is used most effectively when the estimates on how large stacks should be are as tight as possible. A related project provides a tool to do this: stack-estimator.
The TinyThread library is available for download: Tarball. (Updated Nov 21, 2006. This version works for TinyOS 1.x.).
Updated Oct 21, 2007.The TinyThread library for TinyOS 2.x is available for download: Tarball