You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
POSIX guarantees that multi-buffer scatter gather is executed as a single atomic operation. Windows, unless you opened with O_DIRECT, does not.
AFIO needs to emulate the POSIX behaviour using either memcpy to form a single buffer when buffers are small, or byte range locks when the buffers are large.
The text was updated successfully, but these errors were encountered:
Upon reflection, this will need some new file_flags:
file_flags::win_scatter_gather_disable_locking - don't byte range lock the region being scatter gathered to emulate POSIX atomicity guarantees. This locking would only happen if the scatter gather amount exceeds maybe 1Mb anyway as otherwise we'll use memcpy.
file_flags::win_scatter_gather_atomic_extend - use a zeroed page single append to atomically advance the file extent, then non-atomically perform the gather write over the zeroed section.
Combining these two flags should yield maximum atomic append performance on Windows at the cost of torn reads and writes. For some applications e.g. my transactional database that's fine.
POSIX guarantees that multi-buffer scatter gather is executed as a single atomic operation. Windows, unless you opened with O_DIRECT, does not.
AFIO needs to emulate the POSIX behaviour using either memcpy to form a single buffer when buffers are small, or byte range locks when the buffers are large.
The text was updated successfully, but these errors were encountered: