[omniORB] Single Threaded Policy: really same thread?

baileyk@schneider.com baileyk@schneider.com
Tue Dec 17 17:57:02 2002


Having recently dug into the various thread models used by omniORB (
thread-per-connection, thread pool with or without connection watching )
and the implementations, I'm pretty sure you won't find a way to tie a
thread to a servant, other than the MAIN_THREAD model you already know
about.

I'd recommend just starting your own thread for your servant(s) and pass
the request between the ORB thread and your own thread.  I do this to
achieve a server side version of asynchronous method invocation.  I have
long running requests, which the client shouldn't have to be blocked for.
I write my own polling/callback interfaces and queue the long running
request on my own thread pool.  Even if omniORB supported AMI, I would have
probably done this anyway since I can return status messages to the polling
interface instead of just finding out if it's done or not.

You would need to block the ORB thread until the "apartment" thread is done
with the request of course, if you want to maintain the sychronous
request/reply pattern that CORBA normally uses.  I let the ORB thread
return as soon as the task is queued to my thread pool.  But the idea is
basically the same.

Kendall



                                                                                                                             
                    Kevin Matassa                                                                                            
                    <kevin.matassa@adobe.com>          To:     "'jorgefm@cirsa.com'" <jorgefm@cirsa.com>,                    
                    Sent by:                            "'omniorb-list@omniorb-support.com'"                                 
                    omniorb-list-admin@omniorb-s        <omniorb-list@omniorb-support.com>                                   
                    upport.com                         cc:                                                                   
                                                       Fax to:                                                               
                                                       Subject:     RE: [omniORB] Single Threaded Policy: really same        
                    12/17/2002 11:06 AM                 thread?                                                              
                                                                                                                             
                                                                                                                             




I've tried this setting to no avail on my XP box.  The only way I see the
same thread is by defining the MAIN_THREAD model in my POA.

-Kevin