Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Memory Mapped Files
Memory Mapped Files [message #39808] |
Thu, 02 May 2013 09:38 |
crydev
Messages: 151 Registered: October 2012 Location: Netherlands
|
Experienced Member |
|
|
Hello,
I'm building a program where I need to write data from a list/vector to the memory with very high I/O performance, because it has to be very fast. In this case you have to be thinking of around ~1 GB of raw data.
I have been looking at memory mapped files. I think this is a very good solution for me. What I looked for first after I got it to know though, was looking for a solution embedded in U++. I couldn't find one. Is there a solution for using memory mapped files? Or do you guys/girls maybe have another solution then memory mapped files that I should have a look at?
Thanks in advance!
crydev
|
|
|
|
Re: Memory Mapped Files [message #39813 is a reply to message #39808] |
Thu, 02 May 2013 20:48 |
|
Hi crydev,
crydev wrote on Thu, 02 May 2013 09:38 | write data from a list/vector to the memory
|
Is that really what you wanted to write? If yes, then copying data from Vector to other location in memory can be as simple as calling memcpy(dest, vector.Begin(), count*itemsize).
If you actually meant copying from/to file on disk, then Streams are probably the easiest way to go. AFAIK there is currently nothing using memory mapped files in U++. But to use it for storing, it should be just a simple call to mmap (on Linux) followed by memcpy.
Best regards,
Honza
|
|
|
|
Goto Forum:
Current Time: Sat Apr 20 05:08:19 CEST 2024
Total time taken to generate the page: 0.08251 seconds
|