Most recently, we are working on enabling thread-based programming for the resource-constrained devices employed in sensor networks. In contrast to the standard approach, we employ a compiler that translates thread-based programs into event-based programs. The results of our extensive evaluation show that this approach gives you the comfort of threads with very minimal resource overhead.