On Fri, Nov 23, 2007 at 11:49:03AM +0300, [EMAIL PROTECTED] 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.