Protothreads
dunkels.com
dunkels.com
Interesting pattern though. I see the similarity with Duff's device, but hadn't ever really imagined a use for that outside of confusing SOFT1001 students...
The technique is useful to a point. I used a similar technique for a project and the inability to use locals threw off new hires (who usually created a bug before understanding why).
The bigger problem than educating new users though was that as the number of threads scales up (or grows in hierarchy) you burn more and more CPU time stacking/unstacking your calls just to get to the check that "whoops, this thread should still have been blocked." Between that and implementing preemption, at some point you just have to buckle down and pay for stacks.
http://dunkels.com/adam/pt/publications.html
The context for a lot of "wireless sensor networks" discussion in the paper is that Adam's research group was primarily focusing on sensor networks at the time.
I presume you are the same Muneeb Ali listed as co-author? The website mentioned in your profile seems to be down.