title: Global variable changes only momentarily, is this because of simultaneous read/write?
body: <p>I have a global variable and multiple threads which are consistently reading the variable every few seconds. </p>
  
  <p>Now I have a method in one thread which writes to the variable, and when I print out the global variable within the function where I am writing to it, I see the write has taken place and the variable value is changed as desired.</p>
  
  <p>But when I read from outside the scope of the function immediately after it executes, the global variable has in fact not changed, and the write has not been successful.</p>
  
  <p>Does it sound like this is due to simultaneous read/write? I'm thinking there is something going on I don't understand, though intuitively I can't see how multithreading would change anything as the global variable <i>is</i> being changed at least momentarily.</p>
  
  <p>No writes are happening other than the one mentioned.</p>
  
  <p>I haven't read up on multithreading too much so I just want a high-level "yes this is possible and makes sense with multithreading and global variables" and I will read up as necessary.</p>