Fog Creek Software
g
Discussion Board




Marshalling UDT, Parameters, or Array

Can any of you COM experts tell me what is the most efficient one to marshall cross-process?

I'm thinking that UDT and Array have to be similar because a UDT is uses a pointer offset method for accessing it's members too.  I could be wrong though (but I've been looking around for a while).

Also, how would either of these two compare with just passing a bunch of ByVal parameters to an out of process procedure?  I like the UDT method the best, because it doesn't require a huge list of parameters.

Thanks.

Been Searching
Tuesday, February 3, 2004

It's not that one or the other is more efficient (although marshalling a variable sized array also means marshalling the element count somewhere). An array of 8 ints would be equivalent to marshal as a UDT with 8 ints in it.

Brad Wilson (dotnetguy.techieswithcats.com)
Tuesday, February 3, 2004

Okay, but how about those compared to passing multiple parameters?

Been Searching
Tuesday, February 3, 2004

The amount of data marshalled is still essentially the same.

Brad Wilson (dotnetguy.techieswithcats.com)
Wednesday, February 4, 2004

It depends on the memory copy call too, if you switch between kernel mode and user mode a lot your software will shit itself in a hurry in the wrong situation (like scalability).

Li-fan Chen
Wednesday, February 4, 2004

If you dont' copy by value, the other process has to marshall every request of every node (pointer or not). Copy by value gives the consumer a copy of the data (eliminating the transport cost)

Li-fan Chen
Wednesday, February 4, 2004

Ok, I guess a list of parameters is just an array when it comes down to the assembly anyway right?  So, all three must be similar.

I will be passing by value definitely.  Thanks for your help all!

Been Searching
Wednesday, February 4, 2004

*  Recent Topics

*  Fog Creek Home