Search code examples
c++boostmemory-mapped-filesmemory-mapping

Boost mapped_file or file_mapping


I'm creating a file-based Octree of a Point Cloud in order to manage filters on really big file (that can't be stored in ram). The bottleneck of this method, so far, is the I/O of the leaves (because I often have to write, rewrite files and read files ...)
So I would like to use memory mapped file technique to make it faster, and I heard about Boost.
But when I search for tutorials, I have seen 2 techniques :
One use #include <boost/iostreams/device/mapped_file.hpp>
and the other #include <boost/interprocess/file_mapping.hpp>.

In my casae, I will have to write really often entires vectors of 3D points in file, then get all informations in these files and recreate vectors from them. A lot of I/O operation with probably a lot of files.
I was wondering which one I have to use? In which case I have to use one instead of the other?

Thanks!

P.S : Is there a difference between boost iostream mapped file and boost interprocess mapped file? I have seen this post, but it doesn't help me for my particular problem.


Solution

  • You can use any of these, however: