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 operat- ing systems rely on events due to their efficiency, but make code management difficult. Others rely on threads for devel- oper comfort, but at the cost of reduced runtime efficiency. In this paper we try to combine the best of both worlds by offer- ing 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 appli- cation 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.