[Tinyos-help]:Is the "Task" asynchronous??

Renee Azhen azhen_renee at yahoo.com.cn
Sat Jan 12 11:20:30 PST 2008


dear all,
  I am really lost in my work, I want to know whether the task is asynchronous with the Thread which post it.
  For instance, here is demo event which is used to get process message when having received from the serial:
   
    event message_t *UartReceive.receive(message_t *msg,  void *payload,
1.       uint8_t len) {
  2.       code 1 do sth here;
  3.       code 2 do sth here;
  4.       code 3 do sth here;
  5.       post radioSendMessage();
  6.       getSensorData(); 
  7.       return SUCCESS;
  }
  when the line 5 "post radioSendMessage()" is executed,  Can the line 6(getSensorData();) be executed if the task radioSendMessage is not ended??
  or the line 6 can't be executed until the radioSendMessage task has ended its execution.
   
  In my understanding, I think the take which is post by the Father Thread is asynchronous with the father Thread, each task which has already been post will be stored in a Task Stack, so getSensorData can be executed smoothly, even radioSendMessage() is still waiting in the Task Stack.
   
  But in fact, in my experient, I set the message sending rate from the PC to the mote 1000 times/sec, but actually, the PC can only send a message/sec with the code post radioSendMessage(); existing, but if comment line 5, it can receive message very quickly, So I suppose when posting a task, the task is synchronized with the father thread, no asynchronous.
   
  Am I right?
   
  really thanks for your help
  Sam

       
---------------------------------
雅虎邮箱传递新年祝福,个性贺卡送亲朋! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080113/8f78c315/attachment.html


More information about the Tinyos-help mailing list