[omniORB] issues with multiple orbs in a server gui app
Jason Dolan
jason at pcc.com
Wed Jan 18 11:24:09 GMT 2006
Duncan Grisby wrote:
> On Wednesday 18 January, Jason Dolan wrote:
>
> [...]
>
>>>The CORBA standard does not require ORB_init to return a newly
>>>created
>>>ORB. In fact most implementations will always return only one. Thus, if
>>>you shutdown that single ORB, the other threads/windows can't access it
>>>anymore.
>>>
>>
>>Ok, that clears some things up. That makes me confused about a few
>>other things however...
>>
>>How is it I can run m_pORB->run() for each window if in fact there is
>>just one orb? What is really happening when I call m_pORB->run() for
>>each window?
>
>
> Absolutely nothing. The thread from which you call run() just blocks
> waiting for the ORB to be destroyed. Any number of threads can be
> blocked in run(), but none of them will do anything.
>
Right, but since each window has a gui, that gui expects not to be
blocked. So I need to create a separate thread to be blocked by
ORB::run() all the while the gui is running on happily.
> omniORB always creates its own threads to handle incoming calls and do
> all the other things the ORB needs to do. You do not need to call
> ORB::run() at all. There is no "event loop" for you to run.
>
hmm, now I'm really confused... you don't need to call ORB:run() at all?
How does it start listening for incoming calls then?
> Perhaps it would be helpful for you to explain what it is your
> application is doing, and why you want to have a separate CORBA event
> loop for each window you have open.
>
My application is pretty complex, so I'll try to keep it simple...
My client has a base window. From that window I can open new windows.
These new windows are the ones I'm talking about above. When a new
window opens, it makes a CORBA call to another server application(not
mentioned here). Its call tells the server that it can send commands to
that new window (i.e. it gives the server it's IOR). It then starts up
its ORB instance and waits for commands. The server using that window's
unique IOR can then send commands to that specific window.
Why I'm doing this is beyond the scope of this conversation... I guess
you can just trust that the server knows all the windows on the client
by each windows IOR. And it needs the ability to send messages to an
individual window by that IOR. To achive this, each window needs it's
own CORBA server running to listen for the incoming commands.
> Cheers,
>
> Duncan.
>
More information about the omniORB-list
mailing list