0

Hi everyone!!

First of all am quite new to cpp especially under linux.

I am currently working on a small project under Linux and am having to deal with large number of data(larger than 1 GB). numerous number of operation is to be done with these data. for example: sorting, searching, comparing ... etc. so in order to perform all these operations it is important that these data are in the memory...

in order to deal with such a large amount of data am thinking of using a memory mapped file..
can anyone help me or guide me in the steps of creating a memory mapped file?

Please help ..
Thanking in advance

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by james_zheng
0

hi KDan !
the following steps tell u how to create a memory mapped file:
1. use 'open' function to get a file description;
2. create a memory maped file using 'mmap' function, which returns a pointer to the address of the memory;
3. 'munmap' function close a memory maped file;
4. 'close' to close the file;
btw:why not use database operation instead?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.