Shared Memory
The fastest way for processes to communicate is directly, through a shared segment of memory. When more than two processes attempt to read and write shared memory simultaneously, the memory contents can become inaccurate. This potential inaccuracy is the major difficulty with using shared memory.
To avoid such inaccuracy,
you can use the APIs of the
libmemcontext
library. These APIs enable you to control access to a
shared memory. Using this library prevents a thread from accessing memory that
is not relevant to its current operation. If memory context is enabled, before
accessing the memory segment, a process locks the memory for its use on entry
and releases the lock on exit. This process ensures that multiple processes will
not be able to modify the memory segment at the same time. This feature is
useful when you are working with in-memory databases.
Note:
Support of the shared memory context is available only for 64-bit applications that use OSM segments on M8 systems.