ACM Home Page
Please provide us with feedback. Feedback
Protothreads: simplifying event-driven programming of memory-constrained embedded systems
Full text PdfPdf (307 KB)
Source Conference On Embedded Networked Sensor Systems archive
Proceedings of the 4th international conference on Embedded networked sensor systems table of contents
Boulder, Colorado, USA
SESSION: Operating systems table of contents
Pages: 29 - 42  
Year of Publication: 2006
ISBN:1-59593-343-3
Authors
Adam Dunkels  Swedish Institute of Computer Science
Oliver Schmidt  Swedish Institute of Computer Science
Thiemo Voigt  Swedish Institute of Computer Science
Muneeb Ali  TU Delft
Sponsors
SIGMOBILE: ACM Special Interest Group on Mobility of Systems, Users, Data and Computing
SIGCOMM: ACM Special Interest Group on Data Communication
SIGOPS: ACM Special Interest Group on Operating Systems
SIGMETRICS: ACM Special Interest Group on Measurement and Evaluation
ACM: Association for Computing Machinery
SIGBED: ACM Special Interest Group on Embedded Systems
SIGARCH: ACM Special Interest Group on Computer Architecture
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 17,   Downloads (12 Months): 174,   Citation Count: 10
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1182807.1182811
What is a DOI?

ABSTRACT

Event-driven programming is a popular model for writing programs for tiny embedded systems and sensor network nodes. While event-driven programming can keep the memory overhead down, it enforces a state machine programming style which makes many programs difficult to write, maintain, and debug. We present a novel programming abstraction called protothreads that makes it possible to write event-driven programs in a thread-like style, with a memory overhead of only two bytes per protothread. We show that protothreads significantly reduce the complexity of a number of widely used programs previously written with event-driven state machines. For the examined programs the majority of the state machines could be entirely removed. In the other cases the number of states and transitions was drastically decreased. With protothreads the number of lines of code was reduced by one third. The execution time overhead of protothreads is on the order of a few processor cycles.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
T. Abdelzaher, J. Stankovic, S. Son, B. Blum, T. He, A. Wood, and C. Lu. A communication architecture and programming abstractions for real-time embedded sensor networks. In Workshop on Data Distribution for Real-Time Systems, Providence, RI, USA, May 2003.
2
 
3
4
 
5
R. Cunningham and E. Kohler. Making events less slippery with eel. In Proceedings of the 10th Workshop on Hot Topics in Operating Systems (HotOS-X), Santa Fee, New Mexico, June 2005. IEEE Computer Society.
6
 
7
A.L. de Moura and R. Ierusalimschy. Revisiting coroutines. MCC 15/04, PUC-Rio, Rio de Janeiro, RJ, June 2004.
 
8
T. Duff. Unwinding loops. Usenet news article, net.lang.c, MessageID: <2748@alice.UUCP>, May 1984.
 
9
A. Dunkels. Protothreads web site. Web page. Visited 2006-04-06. http://www.sics.se/~adam/pt/
10
11
 
12
A. Dunkels, B. Grönvall, and T. Voigt. Contiki - a lightweight and flexible operating system for tiny networked sensors. In Proceedings of the First IEEE Workshop on Embedded Networked Sensors, Tampa, Florida, USA, November 2004.
 
13
A. Dunkels, O. Schmidt, and T. Voigt. Using protothreads for sensor node programming. In Proc. of the Workshop on Real-World Wireless Sensor Networks (REALWSN'05), Stockholm, Sweden, June 2005.
 
14
J. Ganssle. The embedded muse. Monthly newsletter. http://www.ganssle.com/tem-back.htm
15
 
16
R. Gummadi, O. Gnawali, and R. Govindan. Macro-programming wireless sensor networks using kairos. In Proc. of Distributed Computing in Sensor Systems (DCOSS)'05, Marina del Rey, CA, USA, June 2005.
17
 
18
19
 
20
J. Jeong. Analysis of xnp network reprogramming module. Web page, October 2003. Visited 2006-04-06. http://www.cs.berkeley.edu/~jaein/cs294 1/xnp anal.htm
 
21
 
22
 
23
Framework Labs. Protothreads for Objective-C/Cocoa. Visited 2006-04-06. http://www.frameworklabs.de/protothreads.html
 
24
H.C. Lauer and R.M. Needham. On the duality of operating systems structures. In Proc. Second International Symposium on Operating Systems, October 1978.
25
 
26
P. Levis, S. Madden, D. Gay, J. Polastre, R. Szewczyk, A. Woo, E. Brewer, and D. Culler. The Emergence of Networking Abstractions and Techniques in TinyOS. In Proc. NSDI'04, March 2004.
27
 
28
M. Melkonian. Get by Without an RTOS. Embedded Systems Programming, 13(10), September 2000.
 
29
 
30
J. Paisley and J. Sventek. Real-time detection of grid bulk transfer traffic. In Proceedings of the 10th IEEE/IFIP Network Operations Management Symposium, 2006.
 
31
 
32
Z.B. Simpson. State machines: Cooperative mini-kernels with yielding. In Computer Game Developer's Conference, Austin, TX, November 1999.
 
33
S. Tatham. Coroutines in C. Web page, 2000. http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
34
 
35
R. von Behren, J. Condit, and E. Brewer. Why events are a bad idea (for high-concurrency servers). In Proceedings of the 9th Workshop on Hot Topics in Operating Systems, May 2003.
36
 
37
M. Welsh and G. Mainland. Programming sensor networks using abstract regions. In Proc. USENIX/ACM NSDI'04, San Francisco, CA,, March 2004.

CITED BY  10

Collaborative Colleagues:
Adam Dunkels: colleagues
Oliver Schmidt: colleagues
Thiemo Voigt: colleagues
Muneeb Ali: colleagues