[Tinyos-devel] reentrancy

John Regehr regehr at cs.utah.edu
Fri Jun 15 13:56:31 PDT 2007


I'm trying to figure out what sort of reentrant calls a correct nesC component 
needs to defend against.

Just to be totally clear, what I mean here is: when a component calls a command 
or signals an event, the flow of control may next enter the component (1) when 
the call returns or (2) through a new command/event invocation.  I am interested 
in case 2.  Interrupts do not enter the picture, this is all about sequential code.

The first hint in Phil's book is "It’s dangerous to signal events from commands, 
as you might cause a very long call loop, corrupt memory and crash your 
program."  This implies that commands should return directly whereas events may 
reenter through one or more commands before the event call itself returns.  Does 
this correspond with current practice and with the mental model that TinyOS 2.0 
hackers have of their components?

I vaguely remember that an old version of TinyOS came with a tool that actually 
checked for violations of Phil's suggestion.  Is there any interest in reviving 
such a thing, or do people prefer to be able to violate this suggestion under 
controlled circumstances?

Thanks,

John


More information about the Tinyos-devel mailing list