---------- Forwarded message ----------
From: David Gay <[EMAIL PROTECTED]>
Date: Jun 13, 2006 10:41 AM
Subject: Re: [Tinyos-help] NesC and TinyOS
To: Adam <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
On 6/13/06, Adam <[EMAIL PROTECTED]> wrote:
(1)
void foo()
{
c = d;
}
......
atomic
{
a = b;
foo();
}
.......
First question is: does atomic protect the variable in both side. In this
example, are all variables (a,b,c,d) protected? Or just a and c are
protected.
All variables are protected. Atomic statements are defined to be
"serialisable", i.e., you can assume nothing else happens during the
execution of an atomic statement (and, in fact, they are simply
implemented by disabling interrupts...).
Another question is, since async event can still interrupt the atomic
section (as you mention in the manual).
Async events cannot interrupt atomic statements.
David Gay
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help