Threads2Events: An Automatic Code Generation Approach

Alexander Bernauer, Kay Römer, Silvia Santini, Junyan Ma


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.

Original languageEnglish
Title of host publicationHotEmNets '10 Proceedings of the 6th Workshop on Hot Topics in Embedded Networked Sensors Article No. 8
Number of pages5
Publication date01.12.2010
Article number8
ISBN (Print)978-1-4503-0265-4
Publication statusPublished - 01.12.2010
Event6th Workshop on Hot Topics in Embedded Networked Sensors
- Killarney, Ireland
Duration: 28.06.201029.06.2010
Conference number: 85135


Dive into the research topics of 'Threads2Events: An Automatic Code Generation Approach'. Together they form a unique fingerprint.

Cite this