Threads2Events: an automatic code generation approach

  • Authors:
  • Alexander Bernauer;Kay Römer;Silvia Santini;Junyan Ma

  • Affiliations:
  • Institute for Pervasive Computing, ETH Zurich, Zurich, Switzerland;Institute for Pervasive Computing, ETH Zurich, Zurich, Switzerland and University of Lübeck, Germany;Institute for Pervasive Computing, ETH Zurich, Zurich, Switzerland;Institute for Pervasive Computing, ETH Zurich, Zurich, Switzerland

  • Venue:
  • Proceedings of the 6th Workshop on Hot Topics in Embedded Networked Sensors
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

There is a long-standing dispute on whether and when thread-based programming should be preferred over the event-based paradigm. This dispute has also extended into the wireless sensor networks domain. Many existing operating systems rely on events due to their efficiency, but make code management difficult. Others rely on threads for developer comfort, but at the cost of reduced runtime efficiency. In this paper we try to combine the best of both worlds by offering a full-fledged cooperative thread abstraction with blocking I/O to the C programmer that is compiled into efficient event-based code. We present the basic code transformations and investigate their efficiency using a representative application case study. We find that RAM usage of generated code competes with hand-written code, but further optimizations are required to reduce the code size and the number of CPU cycles.