A Concurrency Abstraction for Reliable Sensor Network Applications

  • János Sallai
  • Miklós Maróti
  • Ákos Lédeczi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4322)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Laurer, H.C., Needham, R.M.: On the duality of operating system structures. SIGOPS Operating Systems Review 13, 3–19 (1979)CrossRefGoogle Scholar
  2. 2.
    von Behren, R., Condit, J., Brewer, E.: Why events are a bad idea (for high-concurrency servers). In: HotOS IX (2003)Google Scholar
  3. 3.
    Lee, E.A.: What’s ahead for embedded software? IEEE Computer, 16–26 (2000)Google Scholar
  4. 4.
    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)Google Scholar
  5. 5.
    Lee, E.A.: The problem with threads. IEEE Computer, 33–42 (2006)Google Scholar
  6. 6.
    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)Google Scholar
  7. 7.
    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)Google Scholar
  8. 8.
    Brand, D., Zafiropulo, P.: On communicating finite state machines. Journal of the ACM 30(2), 323–342 (1983)MATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    Dunkels, A., Grönvall, B., Voigt, T.: Contiki - a lightweight and flexible operating system for tiny networked sensors. In: EmNetSI (2004)Google Scholar
  10. 10.
    Dunkels, A., Schmidt, O., Voigt, T.: Using protothreads for sensor node programming. In: The Workshop on Real-World Wireless Sensor Networks (2005)Google Scholar
  11. 11.
    Abrach, H., et al.: Mantis: system support for multimodal networks of in-situ sensors. In: WSNA, pp. 50–59 (2003)Google Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    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)Google Scholar
  14. 14.
    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)Google Scholar
  15. 15.
    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)Google Scholar
  16. 16.
    Berry, G., Gonthier, G.: The esterel synchronous programming language: Design, semantics, implementation. Science of Computer Programming 19(2), 87–152 (1992)MATHCrossRefGoogle Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • János Sallai
    • 1
  • Miklós Maróti
    • 2
  • Ákos Lédeczi
    • 1
  1. 1.Institute for Software Integrated Systems, Vanderbilt University, 2015 Terrace Place, Nashville, TN 37203USA
  2. 2.Bolyai Institute, University of Szeged, SzegedHungary

Personalised recommendations