|
Boost Users : |
Subject: Re: [Boost-users] [interprocess] Memory mapped file based allocator
From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2009-03-10 09:02:35
On Mon, Mar 9, 2009 at 6:34 AM, dhruva <dhruva_at_[hidden]> wrote:
>
> Hi,
> I am looking for a memory mapped file based allocator that does not map the whole file into memory. The size may be huge and I would not want to map all the contents into process memory. Since my read and write access are sequential, I would like the mapping to happen on demand (based on access violation trying to read an unmapped region of memory). Is there something like that in Interprocess/Boost (since the implementation needs to work both on M$ and GNU/Linux)?
>
> regards,
> dhruva
One solution (which I've used with files of gigabyte size) that you
could consider is writing a class to encapsulate memory mapped files
that exposes the file contents only through a custom iterator class.
These could work together to map and unmap portions of the file as the
iterator position crosses 'page' boundaries. This would give you
something close to on-demand paging.
Stuart Dootson
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net