Question

Is it possible to share a memory region between an application compiled with MinGW and one with Visual Studio ?

I am relying on boost interprocess:

  shared_memory_object shm (create_only, "MySharedMemory", read_write);
  shm.truncate(1000);
  mapped_region region(shm, read_write);
  int *pi = (int *)region.get_address();

I already realized that this is not possible via Cygwin, as the boost shared_memory_object is then created via the Cygwin posix layer.

Was it helpful?

Solution

A simple test program confirms that it is possible. One caveat is to use the exact same boost versions. Between boost 1.53 and 1.54 the unique id creation for the underlying memory mapped file has apparently changed. I did however not check for memory alignment issues.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top