Re: Running Object Table, Marshaling, and Serialization
muybluie@hotmail.com wrote:
I have an app that is being slowed down by the need to serialize large
data structures, so that they can be passed between processes. To be
more precide - ADO recorsets that are being persisted to ADTG, a
Micorsoft format, and being sent through a BSTR to another
application.
This is redundantly expensive - the serialization to ADTG, and then
the marshaling and unmarshaling if the object. What would really make
sense is to pass a pointer to the recordset between the two processes.
It shouldn't be a problem. If I recall correctly, all ADO interfaces are
dual, dervied from IDispatch, and thus readily marshallable.
You should realize that you are still transferring the same amount of
data between processes, just piecemeal rather than all at once. Every
time you, say, request a data field, your request is sent the original
process and the data is marshalled back to you.
Now, here's the part I am not clear about: if I were to attach these
recordsets to a moniler and register them in the running object table,
I will NOT be avoiding marshalling, since the ROT is simply a way to
reference specific objects, but does not implement some special
mechanism (such as shared memory) for sharing the objects themselves?
ROT only stores enough information to be able to marshal an interface
pointer to another process. It knows nothing about, and has no generic
way to access, any data that the object behind this interface pointer
might or might not be managing.
In other words, the ROT will allow me to access a specific instance of
the ADO recordset class, but once I try to access it on my client app,
marshalling will STILL occur.
Of course.
If I want to access objects using shared memory, I will have to
implement my own marshaling.
Yes. And I suspect it would end up looking pretty similar to the
technique you've started with.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925