It's also mistaken, I believe. For example:PeterX wrote:You probably mean this article:
https://www.nextplatform.com/2017/09/11 ... -posix-io/
It's interesting read.
Nothing in the quoted text from the standard says the data written by write() must be persisted when write() returns. Subsequent read()s will read the data from the cache write() has just updated, and be totally consistent with the above requirements.Perhaps the biggest limitation to scalability presented by the POSIX I/O standard is not in its API, but in its semantics. Consider the following semantic requirement taken from the POSIX 2008 specification for the write() function:
That is, writes must be strongly consistent–that is, a write() is required to block application execution until the system can guarantee that any other read() call will see the data that was just written. While this is not too onerous to accomplish on a single workstation that is writing to a locally attached disk, ensuring such strong consistency on networked and distributed file systems is very challenging.After a write() to a regular file has successfully returned:
– Any successful read() from each byte position in the file that was modified by that write shall return the data specified by the write() for that position until such byte positions are again modified.
– Any subsequent successful write() to the same byte position in the file shall overwrite that file data.
If writes are meant to be persisted immediately, then the file must be opened with O_SYNC option, or fsync() to synchronize outstanding writes for files not opened with O_SYNC.