[Tinyos-devel] [Tinyos Core WG] TOSThreads TEP

Eric Decker cire831 at gmail.com
Wed May 21 14:29:34 PDT 2008


On Wed, May 21, 2008 at 8:47 AM, Neil Hancock <neilh10 at biomonitors.com>
wrote:

>  Hi All
>
> Is this TEP available – sounds an interesting discussion.
>

I  originally  found it as originally  posted on the tinyos-devel mailing
list  at
http://mail.millennium.berkeley.edu/pipermail/tinyos-devel/2008-May/


But I just looked and couldn't find it again.  I think that it is TEP 132
but am not sure.  I'm not sure if it is ready to be put out for general
perusal as opposed to internal review.

more comments below.

>  Personally, with 20years of real-time headaches I really support the
> TinyOS split phase event driven model – a washing-machine controller with
> limited RAM isn't for everyone -- oops sorry I meant  a low cost mote with a
> high degree of hardware integration and limited resources isn't for everyone
> – so the "spawnAnewThread" programming model doesn't seem likely to ever be
> viable on low cost TinyOS.
>

Perhaps calling the TinyOS Threads threads was a poor choice in names.  I
personally don't know what else I would have named them.  That said
thinking  of TOS threads  from the perspective of "spawnAnewThread"
progamming model doesn't
really fit TOS threads.  That isn't what they are.  At least how I'm using
them.

TOS Threads does allow for the dynamic creation of threads.  This is to
support downloadable code which is a good thing.
And gives Deluge more flexibility.

I'm using static threads for a number of things.  Principally background
tasks much like what you've described below.  I could use one to handle all
background things but that is a pain.  It is better to seperate them.

One of the big usages I've made of threads is to implement a SD (flash mass
storage driver).  The SD card sits on the SPI bus but has no hardware
support for generating events.  I could have implemented a pure event driver
(based on underlying Timer events) but it was much cleaner using the
TOSThreads approach.

In other words, have TOSThreads makes interfacing to inherently forced
polled hardware much easier.  I'd prefer to tweak the h/w design to have h/w
based event generation but I don't always have that luxury.  :-)

eric
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Baskin School of Engineering
UCSC

It would be nice though to be able to have a low priority background task
> that can run when nothing else is running.  On a number of large systems
> I've worked on, with the capability of having 250+ task  priorities, we've
> limited the system to a band of 4 or 5 task priorities– and then run tasks
> within that band on a round robbin basis. Its just too hard to predict
> system behavior with too many task priorities.
>
>
>
> So I would be interesting to see the TEP if it is going to be released for
> comments before coding is finished.
>
>
>
> Neil
>
>
>
>
>
> *From:* tinyos-devel-bounces at millennium.berkeley.edu [mailto:
> tinyos-devel-bounces at millennium.berkeley.edu] *On Behalf Of *Vlado
> Handziski
> *Sent:* Tuesday, May 20, 2008 3:42 PM
> *To:* Kevin Klues
> *Cc:* TinyOS Core WG; TinyOS Development
> *Subject:* Re: [Tinyos-devel] [Tinyos Core WG] TOSThreads TEP
>
>
>
> Thanks for posting this Kevin. I think it is very important that we have a
> high quality technical documentation to support us in discussing the
> proposal. That's why I suggested that writing a proper TEP would be very
> helpful. I like to congratulate you on the great effort. Please take my
> comments below not as critique on the your design or implementation, but as
> an attempt to start a more high level discussion on the direction we want to
> see TinyOS go, before plunging in the technical details about the actual
> proposal. I sounded most of my concerns directly with you after the
> presentation here at TUB, but now that we have an official proposal, I would
> like to voice some of them on this forum too.
>
> I think that the name of the TEP is misleading. What is on the table here
> is much more then a simple threading library. This is not a simple "add on",
> but a fundamental redefinition of the basic premises of the OS. You are not
> proposing a threading add on to TinyOS, you are proposing a new thread-based
> OS that wants to run TinyOS as a kernel thread.
>
> The component-based model combined with the even-driven nature and the two
> concurrency classes have defined what TinyOS means ever since the "System
> Architecture Directions" paper. TinyOS never tried to be everything to
> everyone, it was designed based on a specific set of assumptions about what
> is important in the (mote-class) networked embedded systems. We all know
> that this simplicity has its price. The split-phase model, having to keep
> eye on the duration of the tasks, etc. It is true that the TinyOS model is
> sometimes very hard for the new users to grok. It is also true that in some
> situations it is hard to naturally decompose the processing in short task
> chunks (crypto routines, etc.).
>
> I understand that threading is seen by many as the natural solution for
> these problems, people coming from the PC world are used to them, they allow
> programmers to forget about concurrency, etc. I think that they just give a
> false sense of simplicity, but I can see how people might want to use them
> with TinyOS also. Many papers have been written on this, yours is the latest
> one, so clearly there is some push to go in this direction. But if we start
> walking down that path, where do we stop? After matching the features of
> Mantis OS and SOS, what's next? Making TinyOS a general purpose OS?
>
> I for one, still believe in the basic soundness of the event-driven model
> even for user/app code. In this sense, I personally have a problem with a
> threading solution that is not completely optional. I don't want to have a
> thread scheduler being run by default. I don't want to pay a price for
> wakeupThread on every interrupt. With all of those things by default in, for
> me this would not be TinyOS anymore.
>
> Vlado
>
>  On Tue, May 20, 2008 at 9:34 AM, Kevin Klues <klueska at gmail.com> wrote:
>
> Attached.
>
> --
> ~Kevin
>
> _______________________________________________
> Tinyos-2.0wg mailing list
> Tinyos-2.0wg at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
>
>
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
>


-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080521/a5cdf043/attachment.htm 


More information about the Tinyos-devel mailing list