We are interested in the time consumption of FlushViewOfFile and msync. Quoting the UnmapViewOfFile documentation:
To minimize the risk of data loss in the event of a power failure or a system crash, applications should explicitly flush modified pages using the
FlushViewOfFilefunction.
Are FlushViewOfFile() and msync() expensive operations? The reason we are asking is that in our application, we may not need to minimize the risk of data loss in the event of a system crash.
Thank you,
They are expensive in the sense that they will move the cached file from memory to disk. Generally you use memory mapped files to avoid doing that! The normal strategy is to flush as infrequently as your program requirements allow.
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