C++ Objects in Unix shared memory

C++ Objects in Unix shared memory

Post by Karl Key » Sun, 28 Feb 1993 03:12:01



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
========================================================================

 
 
 

1. How to create objects in shared memory using C++?

How would one create objects in shared memory using C++?  There are some
problems that I'm faced with and I hope to get some answers/hints/tips .

Does it required one to create objects dynamically in order to make them live
in shared memory ?  If so, how does one initialise the objects ?

To make things more complicated, how does one ensure that objects that
dynamically allocate memory for their members actually allocate shared
memory ?

I would appreciate very much if some kind souls can throw some light on the
problem.

-----------------------------------------------------------------------------
Name:     Teck Sin How                          University of Bath


-----------------------------------------------------------------------------

2. BCM IN-530 mobo supported?

3. C++ objects in shared memory

4. urgent help needed

5. C++ Objects in Shared memory

6. semsys system call

7. Memory management with Unix shared objects

8. Linux 1.44meg demo disk with web browser

9. creating new shared object from existing shared objects ??

10. semaphors & memory share & object share

11. C++'s map,string and Unix's shared memory

12. Problem linking a C++ shared object and C executable

13. linking C++ code to a shared object on AIX