문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top