[Tinyos-devel] Request for comments: TEP-118
Philip Levis
pal at cs.stanford.edu
Tue Feb 5 09:00:15 PST 2008
On Feb 4, 2008, at 11:53 PM, Omprakash Gnawali wrote:
>>> If multiple components can subscribe to updates for the same key,
>>> how
>>> will signaling the updates work?
>>>
>>
>> As per nesC wiring rules, it would be a simple fan-out. There's no
>> return value, so a combine function isn't needed.
>>
>
> Should we then disallow (in the writeup) set or change from within
> changed. Or maybe that is an obvious bad habit.
Disallow might be too strong: strongly discourage makes more sense,
explaining why. The worst case is you have 2+ components fighting for
what the value should be. It would go like this:
A changes value.
update signaled
A handles event
B handles event, changes value
update signaled
A handles event, sees it's different, changes value
B handles event, sees it's different, changes value
update signaled
A handles event, sees it's different, changes value
B handles event, sees it's different, changes value
etc., ad infinitum.
Because, for example, there's nothing stopping someone from posting a
task in changed() and then setting the value in the task. This would
lead to the same behavior, albeit with more task postings.
Phil
More information about the Tinyos-devel
mailing list