Could anyone please explain what memory mapped files are and why this method is better then reading a file with I/O operations when needed? i've read msdn...wiki...and im still confused at why i cant understand how this works/ what it is doing exactly -thx
lochnessmonster
0
Junior Poster
Recommended Answers
Jump to PostWhy memory maps? Exe's, Dll's or shared objects need to be mapped into memory before they can be execute, you can't execute code from a drive it must be mapped into memory(RAM). Is it better? Depends, what are you reading and what are you doing with it.
Jump to PostCheck out the strace of a 'hello, world' program, especially line 9 which opens the standard C library /lib64/libc.so.6, the next line 10 which reads the file and the next line 12 which maps the code from /lib64/libc.so.6 into memory.
execve("./test", ["./test"], [/* 83 vars */]) = …
All 5 Replies
gerard4143
371
Nearly a Posting Maven
lochnessmonster
0
Junior Poster
gerard4143
371
Nearly a Posting Maven
gerard4143
371
Nearly a Posting Maven
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.