[omniORB] multiple omniNames instances

Jonathan Gallmeier jonathan@arlut.utexas.edu
Mon, 01 Nov 1999 08:56:26 -0600


Hi Bruce,

Yes, I am asking wheter or not I can have different threads within the
same process use
different omniNames servers. I am spawning a thread to access a
different machine running
its own omniNames server, each initializing an orb_ptr with
CORBA::ORB_init.
I did not realize that the CORBA::ORB_init is static for each process.
This would certainly break my code!

I'll try the bind_context suggestion. My Naming Service tree should not
change much, since
my system is essentially a semi-real time remote data acquisition system
where data must be
shared among machines -- implying that all my servers and clients should
*always* be running.

Thanks for your help.
jonathan

Bruce Visscher wrote:
> 
> Jonathan,
> 
> I need to understand what you are asking a little better.  Are you
> asking whether you can have different threads within the same process
> using different omniNames servers?  If that is the question then, I
> think the answer to that is no (at least under the current (2.8.0)
> implementation of omniORB).  CORBA::ORB_init is a (process) global
> initialization.  Once you call it (from any thread) calling it again
> from the same or different thread has no effect.
> 
> One solution would be to run each client that needs a different name
> service in a seperate process.
> 
> Another solution would be to register each name service with the other.
> This is accomplished by binding the IOR of the omniNames server (I think
> you use bind_context, not bind) with the other.  I just tried this
> using:
> 
>         nameclt -advanced bind_context foo.names IOR:...
> 
> and it seems to work.  Now the directory tree of the other nameserver is
> visible via:
> 
>         nameclt list foo.names
> 
> Now, how you keep these IORs in synch is another matter.
> 
> HTH,
> 
> Bruce Visscher
> 
> Jonathan Gallmeier wrote:
> >
> > I don't know if what I am trying is legal... could someone let me know?
> >
> > I have two machines, each running a copy of omniNames. I have a client
> > on one machine
> > that needs to be able to communicate with a server on another machine.
> > This client
> > is running in its own thread. At the client's thread startup, I fake the
> > command line
> > arguements with a local char *argv[] array that I fill with
> > -ORBInitialHost machine.domain
> > and -ORBInitialPort 12345. I then go ahead and call ORB_init(...) with
> > the expectation
> > that the local copy of the naming service will be ignored, and the
> > naming service on the
> > other machine will be accessed.
> >
> > what appears to happen is that the local copy of the naming service is
> > accessed, even though
> > I am trying to explicitely use the other machine.
> >
> > Is this legal corba? Any explanation as to why this does not work?
> >
> > I actually have a good reason why I want to run omniNames on each
> > machine... and yes, my code
> > runs fine when the client and server are running on one machine, or when
> > only one naming service
> > is used.
> >
> > any help would be appreciated. thanks.
> >
> > jonathan
> >
> > --
> >
> > -------------------------------------------------------------------------------
> > Jonathan Gallmeier                | We act a though comfort and luxury
> > were
> > email : jonathan@arlut.utexas.edu | chief ingredients of happiness, when
> > all
> > office: (512) 835-3812            | we really wanted was something to be
> > FAX   : (512) 835-3808            | excited about. - Anonymous
> > -------------------------------------------------------------------------------

-- 

-------------------------------------------------------------------------------
Jonathan Gallmeier                | We act a though comfort and luxury
were 
email : jonathan@arlut.utexas.edu | chief ingredients of happiness, when
all
office: (512) 835-3812            | we really wanted was something to be 
FAX   : (512) 835-3808            | excited about. - Anonymous
-------------------------------------------------------------------------------