Re: (ORBit-mt-0.5.7)g_main_iterate(): main loop already active in anotherthread





The closest I could find in the current specification for CORBA was in the
POA section on Threading Models.  It would seem that the ORBIT-mt doesn't
quite match up with the current specification.   I remember seeing "
THREAD_PER_OBJECT" etc mentioned in an "old" talk....  But I can't seem to
locate it.

-Dave


11.2.8.1 POA Threading Models
The POA supports three models of threading when used in conjunction with
multi-threaded ORB implementations; ORB controlled, single thread and
main-thread behavior. The three models can be used together or
independently. All can be used in environments where a single-threaded ORB
is used.  The threading model associated with a POA is indicated when the
POA is created by including a ThreadPolicy object in the policies parameter
of the POA's create_POA operation.  Once a POA is created with one model,
it cannot be changed to the other. All uses of the POA within the server
must conform to that threading model associated with the POA.

11.3.7.1 Thread Policy
Objects with the ThreadPolicy interface are obtained using the POA::create_thread_policy operation and passed to the POA::create_POA operation to
specify the threading model used with the created POA. The value
attribute of ThreadPolicy contains the value supplied to the POA::create_thread_policy operation from which it was obtained. The following values can
be supplied.

    ORB_CTRL_MODEL - The ORB is responsible for assigning requests for an
   ORB-controlled POA to threads. In a multi-threaded environment,
   concurrent requests may be delivered using multiple threads.
    SINGLE_THREAD_MODEL - Requests for a single-threaded POA are processed
   sequentially. In a multi-threaded environment, all upcalls made by this
   POA to implementation code (servants and servant managers) are made in a
   manner that is safe for code that is multi-thread-unaware. The POA will
   still allow reentrant calls from an object implementation to itself, or
   to another object implementation managed by the same POA.
   MAIN_THREAD_MODEL - Requests for all main-thread POAs are processed
   sequentially. In a multi-threaded environment, all upcalls made by all
   POAs with this policy to servants are made in a manner that is safe for
   code that is multi-thread-unaware. If the environment has special
   requirements that some code must run on a distinguished main thread,
   servant upcalls will be processed on that thread. (See Section 4.2.4,
   "Thread-Related Operations," on page 4-9.)


If no ThreadPolicy object is passed to create_POA, the thread policy
defaults to ORB_CTRL_MODEL. Note: In some environments, calling
multi-thread-unaware code safely (that is, using the MAIN_THREAD_MODEL) may
mean that the POA will use only the main thread, in which case the
application programmer is responsible to ensure that the main thread is
given to the ORB, using ORB::perform_work or ORB::run. POAs using the
SINGLE_THREAD_MODEL may need to cooperate to ensure that calls are safe
even when implementation code (such as a servant manager) is shared by
multiple single-threaded POAs.  These models presume that the ORB and the
application are using compatible threading primitives in a multi-threaded
environment.

>> Also i am unable to comprehend the threading policies that have
>> been mentioned on the ORBit-mt web-site. CORBA2.4 spec doesnt carry
>> any explaination about those policies either, so where
>> can i get any documentation on that??
>
>What exactly of the following policies don't you understand?
>
>        * PortableServer_THREAD_PER_OBJECT: all requests to the same
>          object will be serialized. It is not garanteed though, that
>          there is a 1-to-1 relation between object and thread. This is
>          the default: (i.e. it equals PortableServer_ORB_CTRL_MODEL)
>        * PortableServer_SINGLE_THREAD_MODEL: all requests will be
>          serialized. you can however use the orb from multiple threads.
>        * PortableServer_THREAD_PER_REQUEST: every incoming request will
>          be dispatched to a new thread.
>        * PortableServer_THREAD_PER_POA: all requests to the same POA
>          will be serialized.
>        * PortableServer_THREAD_PER_CONNECTION: all requests from the
>          same connection will be serialized.
>
>I think, the description is rather non-ambiguous.
>
> Bye,
> Sebastian





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