Alfredo,

As long as you only ever update your neighbor table in task context
(synchronous context) you don't need an atomic block.  Task execute on
a first-come first-serve basis.  Tasks never preempt other tasks, the
currently running task must complete before the next task can begin. 
That is to say, all tasks are atomic with respect to each other.  You
don't need an atomic block, so the underlying interrupt system can
run.. err.. uninterrupted :).

Cory Sharp <[EMAIL PROTECTED]>

On 1/27/06, Alfredo Quesada <[EMAIL PROTECTED]> wrote:
> Hi
>
> As you know you can post tasks in order to run them
> "when it's possible".
>
> I'd like to know if there's any way to send to sleep a
> task. Let's take a look at an example situation of
> what I'm talking about.
>
> Let's imagine a neighbor table, that you're going to
> update (maybe refresh timestamp, or clear old
> entries..). While checking the table you must keep the
> data consistent, so you have at least 2 ways:
> 1. Keep the updating code inside an atomic block.
> Doing this way you could even loose packets, because
> interrupts are disabled and the transceiver can't
> notify of an incoming packet.
> 2. Protect the same code for example with something
> similar to semaphores. The code for getting it is
> easy, and you can reduce the size of atomic blocks
> (you should only use them when updating the semaphore
> status).
>
> The problem for the second option is that only works
> if you can "send to sleep" the current task and give
> the control to another one (at least for a short
> period of time). Of course It's only possible if
> tinyOS is a multitask OS..
>
> So.. can this (or something similar) be done in
> tinyOS?
>
> regards :D
>
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/
> _______________________________________________
> 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