Subj : Re: deadlock avoidance To : comp.programming.threads From : Dijkstra Date : Thu Jul 07 2005 05:10 am Hi Satendra! > I guess my statement was misinterpreted. What i meant by atomic here > is that if we have lets say an integer i with initial value 0 .Thread > T1 unconditionally modified to 2 (i = 2) then T2 at any time will read > it as either 0 or 2 but nothing in between, I agree that with c++ > objects this might not be true. I still don't understand why a function > who is just checking/reading the value of a global variable can't be > reentrant ? Don't get me wrong either, sorry! I understood your statement. ;-) As I see here, other fellow posters already replied explaining in more detail why it's wrong. Robertwess explained it perfectly, on a reply. You can not warrantee that a simple assignment or check, or read or watherver for that matter, is atomic on every platform on earth. His example of an 8 bit platform assignment/check of a 32 bit word is very enlighten. Cheers, Jose Miguel. .