I use APR library to write large amount of data. Everything works OK, but now I want to create checkpoints during write, where my data is consistent. I want to implement it by writing some data to the mmap-ed file followed by flush.
I can't figure out how to do this with APR. I open file with apr_file_open
, then I create mapping using corresponding function in APR. After that I write data to mmap-ed region and than call apr_file_flush
with file handle that I've passed to apr_mmap_create
but it returns immediately. I think that flush is relatively heavy operation but I can't see any significant difference in performance with or without flush. Am I doing it wrong?