Answers:
Parallel reads in records may see intermittent records depending on the OS, the feed system, and which flags you opened the file with. Below is a brief description of the flags, OS and registration system.
You can lock byte ranges in a file before accessing them using fcntl () on POSIX or LockFile () on Windows.
No O_DIRECT / FILE_FLAG_NO_BUFFERING:
Microsoft Windows 10 with NTFS: update atomicity = 1 byte
Linux 4.2.6 with ext4: update atomicity = 1 byte
FreeBSD 10.2 with ZFS: atomicity update = at least 1 MB, possibly infinite (*)
O_DIRECT / FILE_FLAG_NO_BUFFERING:
Microsoft Windows 10 with NTFS: update atomicity = up to 4096 bytes only if aligned on the page, otherwise 512 bytes if FILE_FLAG_WRITE_THROUGH is turned off, and another 64 bytes. Note that this atomicity is probably a feature of PCIe DMA, not designed in (*).
Linux 4.2.6 with ext4: update atomicity = at least 1 MB, possibly infinite (*). Note that previously Linuxes with ext4 definitely did not exceed 4096 bytes, XFS certainly used a user lock, but it looks like the latest Linux has finally fixed it.
FreeBSD 10.2 with ZFS: atomicity update = at least 1 MB, possibly infinite (*)
You can see the initial results of the empirical test https://github.com/BoostGSoC13/boost.afio/blob/master/fs_probe/fs_probe_results.yaml . The results were generated by a program written using asynchronous file I / O on all platforms. Note that we only test offsets by 512 bytes, so I cannot say if a partial update of the 512-byte sector will break during a read-modify-write cycle.
source share