EDN Admin
Well-known member
<P>Hi,</P>
<P>I need to know if, in a multithread scenario, it is safe to change the value of a primitive variable (int or object reference, for instance) while another thread is reading it.</P>
<P>What I need to avoid is that the reading thread fetch a partially written version of the primitive variable.</P>
<P>Thanks in advance,</P>
<P>Guglielmo</P>
View the full article
<P>I need to know if, in a multithread scenario, it is safe to change the value of a primitive variable (int or object reference, for instance) while another thread is reading it.</P>
<P>What I need to avoid is that the reading thread fetch a partially written version of the primitive variable.</P>
<P>Thanks in advance,</P>
<P>Guglielmo</P>
View the full article