??? 01/09/07 05:12 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#130474 - Word length & Atomicity Responding to: ???'s previous message |
Word length and atomicity are not necessarily tied together. Even when using 8 bit variables you can have atomicity problems if you have a number of related variables. Under Windows you need to be aware of atomicity when dealing with threads. Here they're called 'critical sections'. Also with database engines there are normally methods of record locking to enforce atomicity.
In short - atomicity is a concept and the programmer must understand it. Personally, I don't want the compiler to control critical sections in an embedded environment. The usual way is to disable interrupts - but I may not want that. I might want to only disable serial interrupts as I know certain variables are used with the serial isr. |