This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/21251] Placement into shared memory


------- Additional Comments From mronell at alumni dot upenn dot edu  2005-05-02 16:49 -------
Apologies for my persistence, but  the following is still not clear to
me.  Given the last reply to this concern, I now understand:

   1. Placement into  shared memory is  not possible.  If  processes 1
      instantiates  objects  into  shared memory,  these  instantiated
      objects can not necessarily be accessed by process 2 because the
      vtable  class definitions will  not necessarily  be at  the same
      address in both processes.

So given  the assumption  above, is a  share memory allocator  for the
Standard  Template  Library  (STL)  containers  still  possible?   For
example,  let process  1 create  a vector<T,A>  my_vect where  A  is a
working shared  memory allocator  and T is  a valid  class definition.
The allocator A,  is assumed to correctly allocate  and recycle memory
from an validly  open shared memory segment.  After  process 1 defines
and populates my_vect with objects  of type T, let process 2 similarly
define a  vector using  its own  allocator A, defined  the same  as in
process 1.  The allocator, A,  in process 2 accesses the shared memory
segment in exactly the same way as in process 1.  The address space of
the shared memory segment is  mapped to the same virtual address space
in  both  processes.   If  the   objects  in  the  vector  which  were
instantiated  by process  1 all  point  to process  1's vtable,  won't
process  2 have  trouble accessing  the objects  created by  process 1
because  process  2 may  again  have  its  vtable classes  defined  at
different memory addresses?  How can process 2 make use of the objects
mapped into shared memory by  process 1?  Is a shared memory allocator
for the STL  possible given that object placement  in shared memory is
not possible?  What is the difference between the two concepts and why
does one work (shared memory  allocator) and one not work (placement)?
Can you  point me to a reference  which explains this concept  as I do
not understand.

I am probably missing something obvious.

Thank you,

Marc



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21251


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]