ACE Tutorial 020
Sharing your Memories with persistence

This tutorial mirrors the previous. Instead of using shared memory, this time we'll be using a memory-mapped file.

The cool thing about doing it this way is that we gain persistence of memory even across reboots. I wonder if you could memory map a file that's mounted via NFS?

Like the shared memory tutorial, this one is also very basic and primitive. I'm assuming you've read that one, so I'll just hit the high points this time through..

Kirthika's abstract:

Here, the ACE_Shared_Memory_MM class has been used to provide persistence of the contents of the shared memory resource used by the server and client. A memory_map which is really a file mapped onto memory appears like an array which can be easily manipulated while actually the data is stored in a file thus making the contents permanent. In the previous tutorial, this wasnt possible as we were dealing with shared memory allocated from the RAM.

Again, here too, the example consists of a server and a client sharing memory (the mem_map) and the server writing a a-z string to it which will be successfully converted to uppercase by the client.

Notice that, similarities in usage abound between the previous and the current tutorial which will prove to be a force for templatisation. For that we need to go ahead -- to the next tutorial!

[Tutorial Index] [Continue This Tutorial]