On 2007-11-15, Hardy Griech <[email protected]> wrote:
> Grant Edwards wrote:
>> On 2007-11-14, Grant Edwards <[email protected]> wrote:
>:
>> Protothreads looks promising:
>>
>> http://www.sics.se/~adam/pt/
>
> Thanks for the inspiration, Grant!
>
> At the moment I'm looking for a light-weight mechanism for doing
> 'multi-threading'. Protothread could be one way to do it.
>
> I'm yet struggling a little bit with low power modes. How could this be
> implemented with protothreads?
>
> To me it seems that protothreads are doing some kind of active
> wait.
That's true.
> And that's definitely not my goal, because the device should
> be battery driven.
If you want to go to sleep, that would probably be handled
"above" the protothreads level -- by the main loop that calls
the protothreads.
That main loop would go to sleep, and when it wakes up it could
either just call all of the protothreads once, or it could be
smarter and look at the event that caused it to wake up and
call only the threads that might care about that event.
--
Grant Edwards grante Yow! It don't mean a
at THING if you ain't got
visi.com that SWING!!