This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Fwd: Re: FW: matrix linking]
- From: Olivier Galibert <galibert at pobox dot com>
- To: "george at georgeshagov dot com" <george at georgeshagov dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 23 Nov 2007 10:50:54 +0100
- Subject: Re: [Fwd: Re: FW: matrix linking]
- References: <474693FF.4020706@georgeshagov.com>
On Fri, Nov 23, 2007 at 11:49:03AM +0300, george@georgeshagov.com wrote:
[Changing the _vptr or C equivalent dynamically]
> I would like the community would have considered the idea. I am ready to
> answer all the questions you might have.
Changing the virtual function pointer dynamically using a serializing
instruction is I'm afraid just the tip of the iceberb. Even
forgetting for a second that some architectures do not have
serializing instructions per se, there are some not-so-simple details
to take into account:
- the compiler can cache the vptr in a register, making your
serialization less than serialized suddently
- changing a group of functions is usually not enough. A component
version change usually means its internal representation of the state
changes. Which, in turn, means you need to serialize the object
(whatever the programming language) in the older version and
unserialize it in the newer, while deferring calls into the object
from any thread
- previous point means you also need to be able to know if any thread
is "inside" the object in order to have it get out before you do a
version change. Which in objects that use a somee of message fifo
for work dispatching may never happen in the first place
Dynamic vtpr binding is only the start of the solution.
OG.