[Tinyos Core WG] atomic statements and visibility
David Gay
dgay42 at gmail.com
Wed May 23 15:47:46 PDT 2007
I've just made a small change to the __nesc_atomic_start and end
functions on the atmega128, msp430 and pxa27x by adding
asm volatile("" : : : "memory"); /* ensure atomic section effect visibility */
The goal of this is to ensure that the effects of an atomic statement
are visible to the rest of the code as soon as the atomic statement
terminates. Without these statements, it's conceivable that the
compiler might stash some pending state changes in registers or
somewhere until some surprisingly late date.
The impact on code size and performance should be minimal. See the
attached paper (from the PLOS workshop last year) for way more detail
on this than you probably wanted to know.
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc.pdf
Type: application/pdf
Size: 100252 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-2.0wg/attachments/20070523/093939d1/doc-0001.pdf
More information about the Tinyos-2.0wg
mailing list