On Fri, Mar 18, 2011 at 4:56 AM, Philip Levis <[email protected]> wrote:

>
> On Mar 17, 2011, at 12:18 PM, Francisco Sant'anna wrote:
>
> > Hello,
> >
> > I cannot make nesC to detect potential race conditions in my programs.
> > For example, I can see in the compiler output the flag "-Wnesc-data-race"
> but no data race is detected for following code snippet:
> >
> > implementation
> > {
> >     int my_global_var;
> >
> >     event void Boot.booted () {
> >         call Timer.startPeriodic(10);
> >         call AMControl.start();
> >     }
> >     event void Timer.fired () {
> >         my_global_var = 1;
> >     }
> >     event void AMControl.startDone (error_t err) {
> >         my_global_var = 1;
> >     }
> > }
> >
> > Am I missing something obvious here?
> > I am using TinyOS 2.1.1.
>
> Yes. All of those events are synchronous code: they can't preempt one
> another. So there's no way for there to be a data race.
>
> Phil


Thanks, I missed this "async" keyword.

(Probably it didn't exist by the time you wrote the nesC PLDI paper, right?
Timer.fired was used in a data race example there).

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

Reply via email to