On Oct 8, 2009, at 1:41 AM, Ricardo . wrote: > Hello everyone, > > I got some questions about tasks that can not clarify through > literature. > > Imagine you have two tasks, task1 and task2. If I do "post task1" > and immediately following "post task2" I have guarantee that task1 > will run before task2? In other words, I have guarantee that the > tasks execute in the order that I post them?
Yes, with one caveat. Since only one instance of a task can be posted at any time, then if your program went like this: post task2 .... .... .... post task1 post task2 Then task2 would run first. > Another question: > imagine that my task1 runs for a long time (I know I should not do > this), the call backs are canceled during the execution of the task? > If yes, when the execution of the task ends I get a call back > triggered during the execution of the task Well, if that task signals callbacks they'll clearly execute... components can still signal async events to preempt the task, but all sync events will be from that task's execution. There might be pending tasks that signal events; when your long task completes, those tasks will run and signal their events. I'd suggest reading about sync/async code to understand what's going on. Phil _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
