Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] shared_ptr in shared memory and inheritance
From: Gaetan Gaumer (gaetan.gaumer_at_[hidden])
Date: 2009-02-12 06:08:33


>
>
> First of all, if you use fixed_managed_shared_memory, you want to specify
> the same base address in ever process, otherwise, you're code won't work.

Is it enough to create the segment with the same name in each process :
eg a call to the line below in each process :
fixed_managed_shared_memory
segment(open_or_create,"sharedPtrSharedMemoryTest", 2048);

>
> You solve your issue, I'm afraid you will need to build a table of pointers
> to destructors indexed by a unique number per type (the same number in all
> processes), so that when the base class destructor is called, it makes a
> lookup in the table and calls the correct "destructor" function. Not easy,
> but I think it's the only way. Your hierarchy couldn't be expanded by users
> (they need to register their destructor). It's a limited type of
> "polymorphism".
>

I understand your solution but I don't know wich method I have to redefine.
Because the problem is not really the destructor, but rather the "deleter".
And I don't find how to redefine (and register) the base deleter to call the
derived one.

Could you help me (again...)

Regards,
Gaëtan



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net