Using Protothreads for Sensor Node Programming

Wireless sensor networks consist of tiny devices that usually have severe resource constraints in terms of energy, processing power and memory. In order to work efficiently within the constrained memory, many operating systems for such devices are based on an event-driven model rather than on multi-threading. While event-driven systems allow for reduced memory usage, they require programs to be developed as explicit state machines. Since implementing programs as explicit state machines is hard, developing, maintaining, and debugging programs for event-driven systems is difficult. In this paper, we introduce protothreads, a programming abstraction for event-driven sensor network systems. Protothreads simplify implementation of high-level functionality on top of event-driven systems, without significantly increasing the memory requirements. The memory requirement of a protothread is that of an unsigned integer.

[1]  Roger M. Needham,et al.  On the duality of operating system structures , 1979, OPSR.

[2]  Marvin Theimer,et al.  Cooperative Task Management Without Manual Stack Management , 2002, USENIX Annual Technical Conference, General Track.

[3]  Kay Römer,et al.  Beyond event handlers: programming wireless sensors with attributed state machines , 2005, IPSN 2005. Fourth International Symposium on Information Processing in Sensor Networks, 2005..

[4]  John C. Reynolds,et al.  The discoveries of continuations , 1993, LISP Symb. Comput..

[5]  Adam Dunkels,et al.  Full TCP/IP for 8-bit architectures , 2003, MobiSys '03.

[6]  Adam Dunkels,et al.  Contiki - a lightweight and flexible operating system for tiny networked sensors , 2004, 29th Annual IEEE International Conference on Local Computer Networks.

[7]  Adam Dunkels,et al.  Protothreads - Lightweight Stackless Threads in C , 2005 .

[8]  Robert Szewczyk,et al.  System architecture directions for networked sensors , 2000, ASPLOS IX.

[9]  David E. Culler,et al.  The Emergence of Networking Abstractions and Techniques in TinyOS , 2004, NSDI.

[10]  Eric A. Brewer,et al.  USENIX Association Proceedings of HotOS IX : The 9 th Workshop on Hot Topics in Operating Systems , 2003 .