On Jun 21, 2007, at 9:47 AM, Zhifeng Lai wrote:

Dear Steve,

Thanks a lot for your information!

(1) In TinyOS tutorial, it is said that "Hardware event handlers are executed in response to a hardware interrupt and also runs to completion, but may preempt the execution of a task or other hardware event handler. " (URL: http://www.tinyos.net/tinyos-1.x/ doc/tutorial/lesson1.html). If "no platform implement nested interrupts", you're certainly right. Can anyone confirm this information?

Some platforms do implement nested interrupts. Specifically, the UART stack of the atmega128 declares its transmit interrupts to be preemptible. However, most interrupts are declared non-preemptible.


(2) To my understanding, the keyword "async" is used to specify a piece of code is an asynchronous operation, which means that "operations that occur without a regular or predictable time relation to other events." (URL: http://en.wikipedia.org/wiki/ Asynchronous_operation). I think this meaning is lost when we call async command from task. Is it true that: (1) call async command; (2) call sync command; (3) signal async event; (4) signal sync event all equal to subroutine call. I also want to know the exact meaning of "a task post is an async operation", in Philip Levis's programming guide (I know the mechanism of deferred procedure call).

Asynchrony generally depends on whose perspective you have. From the perspective of the scheduler, tasks run synchronously. From the perspective of a component, its tasks run asynchronously. In the context of nesC, async refers to "from task context." That is "operations that occur without a regular or predictable time relation to a task."

The 'async' keyword does not denote that the code will always execute asynchronously. It denotes that the function can be safely called from code that is async. Synchronous (task) code can execute the function as well. In practice, there is a root calling context, which is either sync or async. The sync root calling context is main; the async root calling contexts are interrupt handlers.

A task post is an async operation because async code can do it.

Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to