|
Boost Users : |
Subject: Re: [Boost-users] [Interprocess] Using shared Memory with different compilers (msvc, mingw)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-10-28 00:51:31
AMDG
BaDBuTz wrote:
> My library uses boost::interprocess' Shared Memory and has to be delivered with msvc(7.1) and mingw compiled versions.
>
> Every instance of the that library opens a connection to the Shared Memory "sharedMemoryMapTest" and communicates via instances of the class "SyncObject".
>
> In my test program ProcessA opens the shared memory, instanciates a SynObject with the identifyer String "id1". ProcessB connects to the same SyncObject and synchronizes with ProcessA.
> If ProcessA and ProcessB are both compiled with the same compiler it works fine. If one process is compiled with mscv and the other is compiled with mingw it fails. (mscv = ProcessA, ProcessB = mingw -> I read my Windows environment variables instead of "id1")
>
>
> Did I make a mistake in my implementation, or is it simply not possible to access the same Shmem with different compiled versions?
>
You can't use std::string in shared memory. It probably works
in this case because of SBO. Regardless, you can't safely use Interprocess
with different compilers because the ABI can be different depending
on the compiler.
In Christ,
Steven Watanabe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net