<< Newer |  Older >>

 Protothreads and ACM SenSys 2006

| | Comments ()
I was a visiting researcher at SICS (Sweden) last fall where I had an amazing time working with Thiemo Voigt and Adam Dunkels. Adam's work on Protothreads recently got accepted at ACM SenSys 2006 and I am listed as a co-author on the paper. SenSys is the premier conference in sensor networks. Much like what SIGCOMM is for networking folks.

acm-logo-small.png
"Threads vs. Event-Driven Programming" is an age-old debate in computer systems research. The late Roger Needham (Cambridge) tried to settle this debate with the "duality argument" in 1979 (essentially saying that threads and events are inter-convertible and are the same thing), but the Threads vs. Events remained a hot debatable topic e.g. Ousterhout (creator of the Tcl scripting language) made strong arguments against Threads in his "Why Threads Are A Bad Idea" invited talk at 1996 USENIX Technical Conference. An example of arguments in favour of Threads can be Eric Brewer's (UC Berkeley) "Why Events Are A Bad Idea" HotOS IX (2003) paper.

Protothreads are extremely lightweight stackless threads designed for severely memory constrained systems. One way to think about Protothreads is that they are a proof-of-concept of the 1979 Roger Needham "duality" argument. They are "something in-between" threads and event-driven programming. Maintaining state-machines makes event driven programming hard, but threads take too much memory to make them feasible on memory-constrained systems (e.g. sensor networks). Protothreads reduce/eliminate the need for maintaining explicit state-machines while keeping the memory overhead very low. Protothreads, unlike traditional threads, are stack-less and their memory overhead is very small (only two bytes per protothread).

For more details, read the Protothreads SenSys'06 paper. Also, you can download and use the Protothreads library.

Protothreads are already gaining popularity (checkout the Google hits). Here are a few interesting links:

Comments

Picture of Muneeb