At 11:07am on Nov 15, electrons from Martin Gercke conveyed:
> Ok,
>
> I got that.
> But what about the following:
>
> What if SendMsg.send is called twice before sendTask is posted?
> Or is this not possible?
>
> I thought about something like this:
>
> SendMsg.send1
> SendMsg.send2 (buffer is overwritten)
> sendTask1 (works with buffer2)
> sendTask2 (works with buffer2)
>
> I am not sure if the scheduler would ever make this exception occur.
> In C++ on windows this could occur if you use 2 different threads.
> In a single thread this couldn't occur. But I am not sure about TinyOS though.
>
First, application should not be calling send until sendDone
has returned. But even if you do this code at the staring
of sendMsg.send will prevent buffer overwrite
if (!state)
Sumit
> Martin
>
> > sendTask is a 'task' and when a task is called(posted is the right word) the
> > scheduler adds it to the list of task to be executed(but will not execute
> > the task immediately). When there are no events to execute the task in the
> > tasklist are executed in FIFO order.
>
>
--
Nothing in the world can take the place of persistence.
Talent will not; nothing more common than unsuccessful men
with talent. Genius will not; unrewarded genius is almost a
proverb. Education will not; the world is full of educated
failures. Persistence and determination alone are
omnipotent.
Calvin Coolidge
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help