title: Multiple threads reading a primitive type
body: <p>If multiple threads read a primitive type that has been previously set and does not change ever after, can they get a wrong value?</p>
  
  <p>For example, assume the following simple code excerpt:</p>
  
  <pre><code>public static final boolean proceed = read(); // Read the value from a file
  
  public static void doSomething() // Method accessed by multiple threads
  {
      if (proceed)
      {
          System.out.println("TRUE");
      }
      else
      {
          System.out.println("FALSE");
      }
  }
  </code></pre>
  
  <p>Assuming that the <code>proceed</code> variable is initialized to <code>true</code>, is it possible that, in one or more of the multiple threads that simultaneously run the <code>doSomething()</code> method, the printed message is <code>FALSE</code>?</p>
  
  <p>If the <code>proceed</code> variable was mutable, surely that would be possible, hence the need for synchronization, or for using an <code>AtomicBoolean</code> (e.g., as per <a href="https://stackoverflow.com/questions/4501223/when-i-need-to-use-atomicboolean-in-java">this question</a>). But in this case <code>proceed</code> is immutable and only set once, during the static initialization of the containing class.</p>
  
  <p>Similarly for other primitive types, if a value is set as final, it should always be thread-safe to access it afterwards, correct?</p>