I would like to store C++ objects in shared memory under Unix. I will
take care of the mutual exclusion required in their access but there
are some more fundamental problems I can see. Any help or information
any of you can offer would be appreciated.
The problems I see are:
1. Shared memory in different processes may be mapped into
different address spaces. Fine for basic objects, but
a problem for any classes with pointers or virtual methods
or virtual data as the pointers will point to the correct
locations only in the creator's address space.
2. Where is the 'vtbl' stored (virtual pointer table)? Is it
stored with the object or somewhere else to do with the
class? If the latter, again only the creator of the object
in shared memory will be able to see it - every other process
may, and probably will, be looking somewhere useless.
3. Pointers to other objects also in shared memory will only work
if the pointers are made relative rather than absolute.
If you have any information about how to store objects in shared memory I
would be interested to hear from you. Please answer directly to me at
the below e-Mail address. If I get useful replies I will of course post
back to the network.
Thanks & regards,
========================================================================
Karl Keyte Phone: +(49) 6151 902041
European Space Operations Centre Fax: +(49) 6151 904041
Robert-Bosch Strasse 5, D-6100 Darmstadt, Germany
========================================================================