Placement into shared memory?
Marc D Ronell
mronell@alumni.upenn.edu
Sat Apr 23 01:56:00 GMT 2005
Hi,
I would like to use placement to instantiate a C++ object into a
shared memory segment and access that object from a second process.
When I test with an integer, the integer is accessible from the second
process. But when I instantiate a C++ class object, it seems a memory
pointer, which is local within the first process, is placed in memory.
The place object is fully accessible and usable in the first process.
I am guessing that the pointer points to the class definition within a
table local to that first process. Unfortunately, that table, which
does not seem to exist at the same address in the second process,
causes the second process to Seg fault when it attempts to access the
object instantiated in shared memory.
What is the current correct approach to instantiating objects in
shared memory so that multiple processes can access the C++ objects?
Thank you.
gcc --version
gcc (GCC) 3.4.3
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
--
More information about the Gcc-help
mailing list