
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++ link 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 library" And Second with only "boost::interprocess link library",
These two shared memories are different, I found offset of some bytes on the 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. Regards, Ion