title: Concurrent access to a public field. Why is it possible to observe inconsistent state?
body: <p>I'm reading B. Goetz Java Concurrency In practice and now I'm at the <code>section 3.5</code> about safe publication. He stated:</p>
  
  <pre><code>// Unsafe publication
  public Holder holder;
  public void initialize() {
      holder = new Holder(42);
  }
  </code></pre>
  
  <blockquote>
    <p>This improper publication could allow another thread to observe a
    partially constructed object.</p>
  </blockquote>
  
  <p>I don't see why it is possible to observe a partially constructed subobject. Assume, that the constructor <code>Holder(int)</code> does not allow <code>this</code> to escape. So, the constructed reference can be observed only by the caller. Now, as <a href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.7" rel="nofollow">JLS 17.7</a> stated:</p>
  
  <blockquote>
    <p>Writes to and reads of references are always atomic, regardless of
    whether they are implemented as 32-bit or 64-bit values.</p>
  </blockquote>
  
  <p>it is impossible for thread to observe a partially constructed object.</p>
  
  <p>Where was I wrong? </p>