[omniORB] is there a way to check if two obj references are colocated?

Pedro Ferreira paf@inescn.pt
Wed, 27 Jan 1999 16:36:30 -0000


>> Hi, I wonder, given two object references (say a_ptr and b_ptr), is
>> there any way to find out if they are colocated (in the same addressing
>> space)?
>
>Why do you want to know that?(It seems a bit like you are trying to find
out
>something that is irrelevant in the CORBA thinking - it just does not
matter where
>an object lives, as long as you can contact and use it.)
>
>Axel Grohmann
>

Real world applications sometimes _do_ need to know it.
Of course, you can always argue that, in a pure distributed system, it
should be irrelevant.

Imagine a scenario where you want to reansfer a large amount of data between
to objects. Due to performance requirements, you can't afford using the ORB
to
do it.
So you decide to create a TCP connection between the two objects and use it
to transfer the data.
Now, if if you knew the two objects were in the same address space, you
could
just pass a handle to a memory area and have a much better performance.

What you should never do is to look inside the object reference as it is, by
definition, opaque. You should always use other means (read, interface
functions)
to do it.
For instance, get process ids and host names, and compare them.

Just my two cents.

Pedro
_____________________________________________________
Pedro Alves Ferreira
INESC - Porto   Tel: 02 209 42 28
Pc da Republica, 93 R/C  Fax: 02 208 41 72
4000 PORTO   e-mail: paf@inescn.pt