Abstract
The prevailing paradigm in the regime of resource-constrained embedded devices is event-driven programming. It offers a lightweight yet powerful concurrency model without multiple stacks resulting in reduced memory usage compared to multi-threading. However, event-driven programs need to be implemented as explicit state machines, often with no or limited support from the development tools, resulting in ad-hoc and unstructured code that is error-prone and hard to debug. This paper presents TinyVT, an extension of the nesC language that provides a virtual threading abstraction on top of the event-driven execution model of TinyOS with minimal penalty in memory usage. TinyVT employs a simple continuation mechanism to permit blocking wait, thus allowing split-phase operations within C control structures without relying on multiple stacks. Furthermore, it provides fine-grained scoping of variables shared between event handlers resulting in safer code and allowing for optimizations in compile-time memory allocation. TinyVT source code is mapped to nesC with a source-to-source translator, using synchronous communicating state machines as an intermediate representation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Laurer, H.C., Needham, R.M.: On the duality of operating system structures. SIGOPS Operating Systems Review 13, 3–19 (1979)
von Behren, R., Condit, J., Brewer, E.: Why events are a bad idea (for high-concurrency servers). In: HotOS IX (2003)
Lee, E.A.: What’s ahead for embedded software? IEEE Computer, 16–26 (2000)
Adya, A., Howell, J., Theimer, M., Bolosky, W.J., Douceur, J.R.: Cooperative task management without manual stack management. In: Proceedings of the USENIX Annual Technical Conference, pp. 289–302 (2002)
Lee, E.A.: The problem with threads. IEEE Computer, 33–42 (2006)
Gay, D., Levis, P., von Behren, R., Welsh, M., Brewer, E., Culler, D.: The nesc language: A holistic approach to networked embedded systems. In: SIGPLAN (2003)
Hill, J., Szewczyk, R., Woo, A., Hollar, S., Culler, D.E., Pister, K.: System architecture directions for network sensors. In: Proc. of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-IX) (2000)
Brand, D., Zafiropulo, P.: On communicating finite state machines. Journal of the ACM 30(2), 323–342 (1983)
Dunkels, A., Grönvall, B., Voigt, T.: Contiki - a lightweight and flexible operating system for tiny networked sensors. In: EmNetSI (2004)
Dunkels, A., Schmidt, O., Voigt, T.: Using protothreads for sensor node programming. In: The Workshop on Real-World Wireless Sensor Networks (2005)
Abrach, H., et al.: Mantis: system support for multimodal networks of in-situ sensors. In: WSNA, pp. 50–59 (2003)
Cheong, E., Liebman, J., Liu, J., Zhao, F.: Tinygals: A programming model for event-driven embedded systems. In: Proceedings of the 18th Annual ACM Symposium on Applied Computing (SAC’03), ACM Press, New York (2003)
Cheong, E., Liu, J.: galsc: a language for event-driven embedded systems. In: Proceedigs of Design, Automation and Test in Europe, vol. 2, pp. 1050–1055 (2005)
Han, C., Kumar, R., Shea, R., Kohler, E., Srivastava, M.: A dynamic operating system for sensor nodes. In: Proceedings of the 3rd international Conference on Mobile Systems, Applications, and Services, pp. 163–176 (2005)
Kasten, O., Römer, K.: Beyond event handlers: Programming wireless sensors with attributed state machines. In: The Fourth International Conference on Information Processing in Sensor Networks (IPSN) (2005)
Berry, G., Gonthier, G.: The esterel synchronous programming language: Design, semantics, implementation. Science of Computer Programming 19(2), 87–152 (1992)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Sallai, J., Maróti, M., Lédeczi, Á. (2007). A Concurrency Abstraction for Reliable Sensor Network Applications. In: Kordon, F., Sztipanovits, J. (eds) Reliable Systems on Unreliable Networked Platforms. Monterey Workshop 2005. Lecture Notes in Computer Science, vol 4322. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71156-8_8
Download citation
DOI: https://doi.org/10.1007/978-3-540-71156-8_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71155-1
Online ISBN: 978-3-540-71156-8
eBook Packages: Computer ScienceComputer Science (R0)