Protothreads

From Contiki
Revision as of 22:35, 10 February 2014 by Rahul (Talk | contribs) (Created page with " Back to Contiki Tutorials __TOC__ === Description === Protothreads are extremely lightweight stackless threads designed for severely memory constrai...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Back to Contiki Tutorials

Description

Protothreads are extremely lightweight stackless threads designed for severely memory constrained systems, such as small embedded systems or wireless sensor network nodes. The advantage here is that they do not waste memory on multiple stacks that are only partially used. They provide sequential execution without the need for large state machines or multithreading. Perhaps the most significant advantage is that they provide conditional blocking inside a process event-handler. Without protothreads, if an event handler did not return, other processes would not be scheduled. Protothreads, on the other hand, allow block operations within the event-handler. As a result, there is less application code, more blocking operations, and event infinite loops.

Implementation

Edited by: Rahul