/dev/null wrote:
Why would you need to worry about more than one thread accessing a 4 byte var? Two reasons, the half-writes we have discussed, and two threads thinking they will increment the var and it only gets incremented once.

Yeah that will fail with more than one writer threads. Maybe I didn't clarify myself there. I was talking about the one writer, one/many reader(s) case. If there are more than one writers, then definitely synchronization would be required. If there's just one, then you can get away without it but the reader threads might get an outdated value which might be bad depending on the case.



-- Ehsan Akhgari Farda Technology <http://www.farda-tech.com/>

Man who drive like hell, bound to get there.

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to