From: Shibu Bera (shibu.ncst_at_[hidden])
Date: 2007-03-09 11:29:35
yes u r right. Linking another library is not important to use interprocess.
But because there is requirment of the other part of the application I am
including the link library of comman c++ while creating executable , If I
woudn't link comman c++, still shared memory would have beed created.
But including comman c++ link library, the shared memory is created is
different from the shared memory which is created without comman c++ link
library. And in the shared memory I am finding offset of some bytes on the
actual value stored in the shared memory.
On 3/9/07, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:
> Shibu Bera wrote:
> > Hi,
> > Thanks Lon for the nice reply. I hope I will get a new method very soon.
> > I have one more query about the shared memory.
> > I create shared memory using boost::interprocess, at linking time I add
> > -lrt -lxml2 -lccext2 -lccgnu2 -ldl (common C++ link library) along with
> > -Wall -pedantic -g -pthread -DBOOST_DATE_TIME_NO_LIB
> > -DBOOST_INTERPROCESS_POSIX_PROCESS_SHARED -lstdc++ -lboost_thread
> > (boost::interprocess link library).
> Why do you define BOOST_INTERPROCESS_POSIX_PROCESS_SHARED? This is an
> internal define that will be generated if Interprocess can detect POSIX
> process-shared mutexes. Otherwise, if you are using gcc, atomic
> operations would be used. Which system are you using, Linux?
> > The common C++ library is added for the other requirement of the
> > application.
> > I open the shared memory form the another process, where "comman C++
> > library" is not added. Segmentation fault is the result.
> > Then I created two shared memory.
> > First with "common C++ link library" and "boost::interprocess link
> > And
> > Second with only "boost::interprocess link library",
> > These two shared memories are different, I found offset of some bytes on
> > actual values stored in the shared memory. I am not finding the way, why
> > this problem is. I want to know how any other link libray may change the
> > data of the shared memory. Please help.
> Sorry, I can't understand your problem properly. Linking another library
> is not important to use Interprocess. Can you elaborate a bit more?
> Please remove the define I mentioned before, because otherwise you might
> have problems.
> Unsubscribe & other changes:
-- Regards, CBu..., Tata Power, Mumbai.......
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk