NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Memory Mapping

This module implements basic server-client memory mapping functionality

At a Glance

Example

A typical scenario would be to have a server process map a region of its own memory so that other processes can access it:

// server program
void main()
{
// map a block of 100MB
ServerMappedFile* mapped_file = new ServerMappedFile();
mapped_file->init("my_file", 100*1024*1024, my_buffer);
// and loop until somebody tell us to stop
while (exit_signal() == false) {}
// delete the mapped_file object, releasing the memory mapping
delete mapped_file;
}

and a client read that mapped file:

// client program
void main()
{
// map the shared block in the client's memory space
MappedFile mapped_file;
void* mapped_buffer = mapped_file.init("my_file", 100*1024*1024);
// and do something with it
do_something( mapped_buffer );
}

Technical Overview

See the Memory Mapping module documentation.