Memory blocks need protecting just the same as variables - for the exact same reasons - after all, a variable is just a small memory block.
There's only one exception to it, which is when the memory holds a variable which can be written with a single instruction (like a 4 byte integer) and you don't care if the reader thread gets an outdated value from time to time. In that case, I'd simply declare the variable as volatile, and access it as usual in the code.
I'm not sure about that. If this were true, why ::InterlockedIncrement( )?
_______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
