title: `write` serialization in POSIX
body: <p>I'm trying to understand this requirement in <a href="https://pubs.opengroup.org/onlinepubs/009695399/functions/write.html" rel="nofollow noreferrer">POSIX-2017</a>:</p>
  
  <blockquote>
    <p>Writes can be serialized with respect to other reads and writes. If a <em>read</em>() of file data can be proven (by any means) to occur after a <em>write</em>() of the data, it must reflect that <em>write</em>(), even if the calls are made by different processes. A similar requirement applies to multiple write operations to the same file position.</p>
  </blockquote>
  
  <p>1) Does "occur" refer to <code>read</code> being called, <code>read</code> returning successfully, or something else?</p>
  
  <p>2) If, while one process is calling <code>read</code>, another process calls <code>write</code> twice on the same file, are there any circumstances where the read will reflect some or all of the second write, but not all of the first?</p>
  
  <pre><code>  |----------------read-----------------|
        |--write1--|       |--write2--|
  </code></pre>
  
  <p>3) How is this handled by implementations (<em>e.g.</em> ext4)? Is this something worth worrying about?</p>