| | |
Creating a memory mapped file
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2008
Posts: 1
Reputation:
Solved Threads: 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
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
•
•
Join Date: Dec 2006
Posts: 1,089
Reputation:
Solved Threads: 164
> man mmap <Enter>
at the command prompt on your system. it should give you all the information that you require.you would see something like this: http://www.freebsd.org/cgi/man.cgi?q...le&format=html
at the command prompt on your system. it should give you all the information that you require.you would see something like this: http://www.freebsd.org/cgi/man.cgi?q...le&format=html
•
•
Join Date: Nov 2008
Posts: 15
Reputation:
Solved Threads: 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?
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?
![]() |
Other Threads in the C++ Forum
- Previous Thread: Using variable as filename
- Next Thread: Questions About C++.NET - I Need Help Please
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






