MemoryMappedFile seems to be the only way to share memory between processes in .NET(?), however I didn't find a way to map a region to the process' virtual memory space, so it can't be really treated as a memory block since there's no way to get the pointer. I'm using pointer to process bitmap for best performance and reusability.
In c++ this can be easily achieved using boost.
Is there a way share a region of memory between processes and use pointer to read/write data?
using (var accessor = mmf.CreateViewAccessor(offset, length))- You can useaccessorto read and write value type items (which includes POCO structs) to and from the MMF at any offset.MemoryMappedViewAccessor.SafeMemoryMappedViewHandlewhich returns aSafeMemoryMappedViewHandlewhich has a load of lower level access methods. It even hasAcquirePointer(Byte*)which returns a pointer to the start of the MMF view - but that requiresunsafecode.