Subj : Re: deadlock avoidance To : comp.programming.threads From : David Schwartz Date : Wed Jul 06 2005 11:57 pm "Satendra" wrote in message news:1120709842.657842.86140@o13g2000cwo.googlegroups.com... > Hi Jose, > 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, Actually, if we're talking POSIX, it can read anything at all. In fact, I think POSIX even allows it to crash. > 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 ? If it does not do so while holding a mutex, it is not only not reentrant but broken. DS .