Lesson 2:
Last updated 29 January 2006

Commands and events that are executed as part of a hardware event handler must be declared with the async keyword (more about the async keyword in Lesson 8).

Because tasks and hardware event handlers may be preempted by other asynchronous code, nesC programs are susceptible to certain race conditions. Races are avoided either by accessing shared data exclusively within tasks, or by having all accesses within atomic statements. The nesC compiler reports potential data races to the programmer at compile-time. It is possible the compiler may report a false positive. In this case a variable can be declared with the norace keyword. The norace keyword should be used with extreme caution.

Please see the nesC Language Reference Manual for more information on programming in nesC.