Training
×

Shared Memory: Mapping

A thread in another process wanting to share physical memory space with the creating thread must execute the MapRtSharedMemory call to map the physical memory area into its virtual address space; the handle could be cataloged in the creating process’s object directory or shared via an object mailbox (discussed earlier in this chapter). Note that the pointer returned by MapRtSharedMemory need not be the same as that returned by AllocateRtMemory, as separate processes have different virtual address spaces.
GetRtSize determines the size of the mapped shared memory. Use this call to check if the mapped memory is the expected size.
FreeRtMemory frees the mapped virtual memory from the calling process’s virtual address space.