views:

53

answers:

1

I wanted to ask something that I think is not clearly specified in the tinyos2 programming manual. When a command or task signals an interface event are the wired functions called immediately, i.e. in the same callstack, or are these signaled events "posted" for later execution?

I tend to believe it's the former one, but just to clarify it.

A: 

I only know TinyOS v1, but I believe they are the same in this regards.

Events are just function calls, and so execute on the same stack as the caller.

If something needs to be posted for later execution, it should be implemented as a task. So, event consumers that need to do long-running work in response to an event but don't want to interfere with interrupt latency should schedule a task, and that task should do a little bit of the work and then schedule a task to do more of the work in the same way.

Nat