Are Posix I/O operations on filenames sequentially coherent?

﹥>﹥吖頭↗ 提交于 2019-12-01 21:36:25

Yes. E.g. from the write() specification ( http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html ):

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.

Note that it says "Any" read(), i.e. you can open() a new fd and read() via that, and those same guarantees are provided.

Incidentally, while this kind of strong consistency makes it easy to reason about the semantics, it also makes providing a POSIX compliant distributed FS with decent performance very difficult, if not impossible.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!