A question about collocated invocations.

in Help Center
hi,there,
Can anybody explain the "collocated invocation" to me please? I can not understand it. What is the meaning of the "collocate" in Ice?
Any help is appreciated.
Thanks in advance.
Best regards--OrNot
Can anybody explain the "collocated invocation" to me please? I can not understand it. What is the meaning of the "collocate" in Ice?

Thanks in advance.
Best regards--OrNot
0
Comments
If the proxy and servant are collocated Ice can bypass all of the network completely and make much more direct calls on the servant which is much faster.
See 29.17 in the Ice manual for more details.
Regards, Matthew
Invoking an operation on a proxy instructs the Ice run time to send a message
to the target object. The target object can be in another address space or can be collocated (in the same process) as the caller—the location of the target object is transparent to the client. If the target object is in another (possibly remote) address space, the Ice run time invokes the operation via a remote procedure call; if the target is collocated with the client, the Ice run time uses an ordinary function call instead, to avoid the overhead of marshaling.
You can also disable the collocation optimization for "remote" calls (or calls through proxies) between a client and server that share the same communicator:
newProxy = proxy->ice_collocationOptimization(false)
(see 29.8 in the Ice manual)
This is for example useful if you want to use a separate thread to run your oneway local operation.
Cheers,
Bernard