[Tinyos Core WG] TOSThreads TEP
John Regehr
regehr at cs.utah.edu
Tue May 20 13:26:54 PDT 2008
> Even in your scenario, you would still need to hack the epilogue I
> think. You would still need a way to tell the tasks to start running
> after the interrupt handler has completed. Otherwise it would just
> return to the point where the interrupted thread was interrupted.
Right; I didn't think it through properly.
> I honestly haven't put much thought into any of this. I guess sort of
> a basic assumption I was making is that atomics would NOT be allowed
> inside thread based code.
As long as the trust model remains the same as it is currently, there's
no problem with threads executing short sections with interrupts
disabled, as long as these are shown to not contain blocking calls.
If you take the cheap locks away from programmers they'll find clever
ways to avoid the expensive locks, leading to poor code...
> I don't have an argument for priority because there are no priorities
> in the current implementation..... Does it make sense to have the
> argument even if its not supported? Or are you suggesting I add
> functionality for priority based scheduling?
I could be wrong but I'd expect that in the normal case people will want
priorities. This is super-simple to implement, for example to support 8
priority levels just have a single byte whose bits are the ready flags.
You could even leave out timeslicing behavior (and the 200 Hz timer)
unless there happen to be multiple threads at a single priority. Or,
just declare that at most 1 thread lives at each priority.
John
More information about the Tinyos-2.0wg
mailing list