21.08.2013 Views

A State-Based Programming Model for Wireless Sensor Networks

A State-Based Programming Model for Wireless Sensor Networks

A State-Based Programming Model for Wireless Sensor Networks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.5. Thesis Organization 5<br />

memory regions. The memory used to store state variables can be managed automatically<br />

by the compiler, very much like automatic variables in procedural<br />

languages. However, this mapping is purely static and thus requires neither a<br />

runtime stack nor dynamic memory management.<br />

<strong>State</strong> variables can reduce or even eliminate the need to use global variables or<br />

manually memory-managed variables <strong>for</strong> modeling temporary program state.<br />

Since state variables provide automatic memory management, they are not only<br />

more convenient to use but also more memory efficient and less error-prone.<br />

Because of state variables OSM programs are generally more memory efficient<br />

compared to event-driven programs.<br />

1.4.4 Light-Weight Execution Environment<br />

The state-based control structure of OSM programs can be automatically compiled<br />

into conventional event-driven programs. Generally, the automatic trans<strong>for</strong>mation,<br />

which is implemented by the OSM compiler, works like manually<br />

coding state in event-driven systems. In the trans<strong>for</strong>mation, however,<br />

the program-state space is automatically reduced and then converted into a<br />

memory-efficient representation as variables of the event program. <strong>State</strong>-specific<br />

actions of OSM are trans<strong>for</strong>med into functions of a host language. Then, code<br />

<strong>for</strong> dispatching the control flow to the generated functions is added to the actions<br />

of the event program. After the trans<strong>for</strong>mation into event-driven code,<br />

OSM programs can run in the same efficient execution environments as conventional<br />

event-driven systems. Thus, the state-based model does not incur more<br />

overhead than the (very efficient) event-driven model and requires only minimal<br />

operating system support.<br />

1.4.5 Evaluation<br />

We use the state-based OSM language to show that a first class abstraction of<br />

state can indeed support well-structured and modular program specifications.<br />

We also show that an explicit abstraction of state can support memory-efficient<br />

programming. To do so, we present an implementation of state variables <strong>for</strong><br />

the OSM compiler. More concretely, we present an algorithm deployed by our<br />

OSM compiler that automatically reclaims unused memory of state variables.<br />

Finally, we show that code generated from OSM specifications can run in the<br />

very light-weight event-driven execution environment on BTnodes.<br />

1.5 Thesis Organization<br />

The remainder of this dissertation is structured as follows. In Chapter 2 we discuss<br />

general aspects of wireless sensor networks. First we characterize wireless<br />

sensor networks and present envisioned as well as existing applications. Then<br />

we discuss state-of-the-art sensor-node hardware, ranging from early research<br />

prototypes to commercialized devices.<br />

In Chapter 3 we present a general background on programming individual<br />

sensor nodes. We start by discussing some general requirements of sensor-node

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!