Could I understand like this: either in async function or atomic section,
all interrupt is disabled by default? Hence there is not need to add
"atomic" in async commands/events? 

How to use IPL in TinyOS programming - any example? I am thinking whether
TinyOS core developer could consider that: instead of disable all interrupt,
we can ensure data consistency through other techniques like critical region
for mutual exclusion. I think, for data consistency, it is not necessary and
not eficient to diable interrupts.

 

-----Original Message-----
From: Philip Levis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 06, 2006 11:03 PM
To: Conor Todd
Cc: Adam; tinyos-help
Subject: Re: [Tinyos-help] Questions regarding concurrency in TinyOS 1.x

On Sep 6, 2006, at 10:14 PM, Conor Todd wrote:

> Interrupts are disabled within async{} blocks.  Therefore, no events 
> can be fired, and nothing will happen except for what's in your async 
> code (unless the batteries die or your mote falls into a pool of 
> molten lava).
>
>       - Conor
>

You mean atomic{} blocks, right?

In terms of language semantics, the promise is that code within an atomic
block will run atomically. In terms of implementations on simple
microcontrollers, this often means disabling all interrupts.

With interrupt priority levels one could, however, use some intelligent
compiler tricks to determine what IPL to disable. E.g., if the variables in
the atomic section are only accessed by interrupt priorities 1 and 3, you
could set the IPL at 3.

Phil

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

Reply via email to