On Nov 28, 6:32 am, ap...@[EMAIL PROTECTED]
wrote:
> On 27 Nov, 21:49, Yakov Gerlovin <yakov.gerlo...@[EMAIL PROTECTED]
> wrote:
>
> > > I have just found a nasty race condition in my java servant which
can
> > > only be explained if the CORBA event dispatching in OrbixWeb occurs
> > > using multiple threads.
>
> > That is according the standard unless the servant is registered under
> > single-threaded POA.
> > The default threading policy for POA is multithreaded and in Orbix
> > 2000 and Orbix 6.3 it is so. I never worked with OrbixWeb, but I see
> > no reason to implement something against the standard.
> > May be you should check the policies of the POA on which your servant
> > is registered.
>
> OrbixWeb 3.0.x is ancient and quite different to the other IONA
> products. On page 408 of the OrbixWeb programmers guide in the section
> titled "multithreaded servers" it says (and I quote):
>
> Where parallism is not required, there is no need to make a server
> multi-threaded.
>
> The way I read this is that by default a server is single-threaded,
> you have to write some extra code (e.g using thread filters) to make
> it multi-threaded. I have discussed this with an IONA consultant, who
> reads this the same way I do. But our OrbixWeb setup seems to
> dispatching CORBA requests from more than one thread.
>
> I am using the apache commons logger which re****ts the thread name in
> each logging record. When I log the incoming CORBA request I see two
> thread names, one is "main" which I expect since that is where my call
> to processEvents is, the other is called "Request Processor". I don't
> know where that thread comes from. It's not one of mine.
>
> -Andrew M.
Don't confuse event dispatching with POA threading policies. The ROOT
POA is single threaded by default. If you want to have multiple
servants processing messages concurrently, you have to define your own
POA with a multi-threaded policy.
I don't believe the CORBA specs says anything about how an orb
delivers the message to the POA. The processEvents operation is part
of the orb, not the POA. It's possible that the orb itself is using 2
or more threads to process incoming messages: one that reads the
socket and enqueues the message, and one or more other threads that
are associated with the processEvents function. Those thread(s) would
check the message queue, and dispatch the call to the appropriate POA.
Thus, it's possible that multiple threads in the orb layer would block
if multiple calls were send to an object associated with a single-
threaded POA.
Mark


|