Search code examples
c++cachingtemporary

How to create a temporary file to helping cache large data in C++?


I have some large vectors, the data of them are coming from some calculations of hard disk files. I've seen many softwares which uses a single temporary file to cache data. I'm very curious about how to do this, but I don't know the name of this technique. I want to change my codes as little as possible. Thank you.

My environment is Windows/MFC/VC10/Boost.


Solution

  • I am pretty sure you're looking for memory mapped files.

    http://www.boost.org/doc/libs/1_47_0/libs/iostreams/doc/classes/mapped_file.html