Dear all,
I am new to boost memory mapping, so this question might look simplistic.
I need to read huge amounts of data (for instance, a 20GB file), and
since memory mapping is quite fast, I was going to use it. However, I
don't know what it would be faster when, due to memory constraints, I
need to partition the file into regions. Moreover, I should treat the
file as a string (I need to perform string operations).
What I'm trying now is just to read the entire file:
boost::interprocess::file_mapping mmap(input_filename.c_str(),
boost::interprocess::read_only);
boost::interprocess::mapped_region map(mmap,
boost::interprocess::read_only);
std::size_t l = map.get_size(), tot_read = 0;
void *ptr = map.get_address();
while (tot_read < l)
{
register std::size_t x = std::min(l - tot_read,
static_caststd::size_t(prealloc));
std::copy_n(static_cast