> Simply reading from a shared variable is not atomic. All accesses to a > shared variable must be synchronized (or "serialized", if you prefer) > with some form of mutual exclusion. (An example of this is on > Solaris/Sparc, where a context switch can occur half-way through an update to > a longword (or is it a word, I'm not sure).
Not all shared memory is created equal. Simple variables that only have one writer at a time by nature do not require additional locking. That is how the old scoreboard worked. Likewise, even a mid-update context switch doesn't matter for a variable that is only incremented/decremented. ....Roy
