5 ms·
if ram and permanent storage becomes the same, in instance, you wont need to "open(" a file, just to point to the memory location of it.
by sebastianavina 12y ago
if ram and permanent storage becomes the same, in instance, you wont need to "open(" a file, just to point to the memory location of it.
- maxidog 12y agoIs that fundamentally different from http://en.wikipedia.org/wiki/Memory-mapped_file http://en.wikipedia.org/wiki/Memory-mapped_file ?
- hrjet 12y agoI was just thinking about this the other day. Yes, a memory-mapped-file is different, because the API is still that of a file. The memory mapping is just a behind-the-scenes optimisation.
- jacquesm 12y agoOnly if you want posix compliance across threads and such. If you just want the contents of the file memory mapped nothing stops you from setting up a shared memory segment and mapping it without that filesystem overhead.
- hrjet 12y agoDoes that work for writes as well? I am not sure if it would work without the OS setting up traps for writes to the pages or explicit flush calls from the app. In the former case, it would be very inefficient, and in the latter, it wouldn't be a clean write-and-forget system.
- maxidog 12y agoYes, it works for writes and support is built-in to current processors. It's faster than conventional file access.
- sedachv 12y agoThat's how the AS/400 works.