Hi, Cory,
Thank you for you reply.
But on the mailing list, most of them deal with interrupt and event
handler. When I concern about is the command function and task.
If as you said command function is like C function and returns
immediately, why does nesC need "asyn command"? Asynchrous command
function executes immediately and preempt tasks.
Is command function without "asyn" like task will be deferred for some
time. For example,
   (1)Non asyn command function
     In component A, it call B.process(), which isn't defiedn as a asyn
command. Then B. process() will be put into the task queue and executed
later.
    (2) asyn command function
     Component A call B.process(), which is asyn command. Then B.process()
execute immediately and preempt other tasks in the task queue.

So my conclusion is that command function without "asyn" is like task,
insead of C-function.

Hui

On Tue, 26 Sep 2006, Cory Sharp wrote:

> Kang,
>
> Please search the TinyOS Help archives.  It seems like we discuss this at
> length at least once a month.  A handy form for search ing is here:
>
> http://www.moteiv.com/community/TinyOS_Information
>
> Short answer: commands and events are just like C functions, they're not
> tasks.
>
> Cory
>
> On 9/26/06, KANG HUI <[EMAIL PROTECTED]> wrote:
> >
> > Dr. Levis:
> > If a command has the following code
> >
> > command result_t A.p(){
> >    ...
> >    post TaskB();
> >    ...
> > }
> > If some module call A.p(), the execution sequence is : first A.p() is
> > put into the task queue and runs to
> > completion, and then TaskB will be executed until a later time. And the
> > return value of A.p() is whether TaskB be put into the task queue.
> > So command and event function is also two kinds of tasks. But a C-like
> > function such as
> > void f(){
> > }
> > is not a task and will return immediately.
> > Is my understanding right? Please correct me. Thanks.
> >
> > Regards,
> > Hui
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>

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

Reply via email to