Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Memory sharing

Both physical memory and virtual memory can have sharing attributes. Physical memory can be shared by assigning specific permissions to virtual memory regions.

A shared memory group is an entity with which access rights can be associated, and from which shared memory regions can be allocated. A memory group that is shareable between OS Services processes is called a memory share. Permissions are granted to a shared memory group when it is created.

Shared memory functionality is exposed through the IMem interfaces: IMemGroup, IMemSpace, IMemMap, and IMemRegion1.

IMemGroup is the interface that allows creation of new memory regions from various memory pools. The IMemGroup object manages the permissions applied to all memory regions created from it. In the simplest case, a client creates a new IMemGroup for each memory region it intends to share, allowing each region to be independently shareable. This is the most manageable configuration from a security perspective. Individual access control is lost when multiple regions are created from the same IMemGroup.

In specialized cases, multiple regions per IMemGroup may be used safely. One example is globally shared read-only regions, such as the executable images that constitute OS Services itself. In these cases, judicious use of a single IMemGroup for multiple regions can improve performance and limit system resource consumption.