views:

681

answers:

2

I have been looking into using Boost.Interprocess to create a disk-backed data structure. The examples on Boost Documentation (http://www.boost.org/doc/libs/1_41_0/doc/html/interprocess.html) are all for using shared memory even though they mention that memory mapped files can also be used. I am wondering whether anyone here has used memory mapped files? Any publicly available code samples to get started (say, a memory mapped file backed map or set)?

A: 

Did you look at the section titled "Memory Mapped Files" in the Boost IPC docs - it is at http://www.boost.org/doc/libs/1_41_0/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.mapped_file

anon
Thanks for the quick reply Neil. I did look at the entire documentation. My confusion is not being able to identify the proper allocators for memory mapped files (from the examples shown for shared memory).
kvs
+3  A: 

You might take look at stldb project that's being actively discussed on boost mail list. It tries to build an ACID database on top of boost::interprocess.

Nikolai N Fetissov
Thanks for the pointer Nikolai! I haven't heard of stldb (though have worked with stxxl in the past); I checked out the code and had a peripheral look it seems they do use memory mapped files to back data structures. Need to explore more before I can be definite about this.
kvs