Gili,
DSYNC is a subset of SYNC.
SYNC requires that all data (file data and file metadata managed by the filesystem) get written out synchronously while DSYNC requires that only the file data get written out synchronously. As for the overhead, I think that is a giant "it depends on the filesystem". Looking at modern filesystems using concepts like copy-on-write, shadow-copying, versioning, checksuming, etc... I imagine it could get expensive to try and block the entire write operation until all that work is done.
Potential for data loss is a more confusing answer to provide; the advantages of asynchronous file I/O is that the underlying filesystem or disk can actually batch or order writes to avoid random I/O and structure the writes in a more sequential manner.
That is great, but to answer your question of data loss, it would be any pending writes that are sitting in the cache before a flush that could be potentially lost. In short, it is hard to say.
In short, the ordering looks like:
I should say I am assuming all these questions pertain to the new AsynchronousFileChannel in Java 7; my apologies if that isn't the case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With