Re: Need for documentation about multithreaded orb's



El viernes 05 de noviembre de 2004 a las 16:53:11 Philip Van Hoof escribió:
> 
> Hi there,
> 
> I've spend a few hours understanding how to get multiple servants
> working, and to let them run tasks in parallel.
> 
> I succeeded but feel that a simple example should be made that shows how
> to startup a server which can serve multiple methods in parallel.
> 
> So not just the mt-calculator sample. It will only launch a background
> process which will run the mainloop. Rather a server with multiple
> PortableServer_POA-childs connected to one rootpoa and on each child a
> servant with different methods defined in multiple idl-files.
> 
> It's not very hard once you understand really every aspect of this
> PortableServer_POA-stuff. But the current documentation is not very
> clear about this. It shows how to launch a corba mainloop in a
> background process. Heh, okay .. but thats not the point of a
> multithreaded CORBA server right? The example will still launch just one
> remote procedure at the time. What if clients want to perform multiple
> remote procedures in parallel?
>

I'm not an expert but AFAIK and if I understand what you want to implement:
a POA that can create a thread for each request, you have to create a POA
with a ORB controlled model (PortableServer_ORB_CTRL_MODEL) policy (this
code is part of the mt-calculator):

    poa_policies->_buffer[0] = (CORBA_Policy)
                    		PortableServer_POA_create_thread_policy (
  				poa,
				PortableServer_ORB_CTRL_MODEL,
				ev);
				
And you can use a thread hint to point out what kind of thread policy you
want to use (mt-caltulator):

    ORBit_ObjectAdaptor_set_thread_hint ((ORBit_ObjectAdaptor) child_poa, 
    					 ORBIT_THREAD_HINT_PER_REQUEST);

I think the options are (I don't know exactly the details of each hint):
 	ORBIT_THREAD_HINT_PER_OBJECT
        ORBIT_THREAD_HINT_PER_REQUEST
        ORBIT_THREAD_HINT_PER_POA
        ORBIT_THREAD_HINT_PER_CONNECTION
        ORBIT_THREAD_HINT_ON_CONTEXT
	ORBIT_THREAD_HINT_NONE
        ORBIT_THREAD_HINT_ONEWAY_AT_IDLE
        ORBIT_THREAD_HINT_ALL_AT_IDLE

This POA will launch a thread to answer each client request

Hope this helps.

-- 

Alejandro García Castro
mailto: acastro igalia com
http://www.igalia.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]