Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / CORBA / November 2007

Tip: Looking for answers? Try searching our database.

Event dispatch in OrbixWeb: single threaded or multi-threaded?

Thread view: 
apm35@student.open.ac.uk - 27 Nov 2007 13:36 GMT
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. Does it? Can any OrbixWeb/IONA expert comment
please?

This servant is a rewrite of one in C++. In Orbix it looks like by
default the event loop is single threaded but this can be changed with
a small amount of code. I assumed that this default behaviour would
also apply to OrbixWeb. It seems like I am wrong.

Regards,

Andrew Marlow
Yakov Gerlovin - 27 Nov 2007 21:49 GMT
> 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.
apm35@student.open.ac.uk - 28 Nov 2007 12:32 GMT
> > 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
[quoted text clipped - 7 lines]
> 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 reports 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.
Mark Woyna - 28 Nov 2007 16:12 GMT
On Nov 28, 6:32 am, ap...@student.open.ac.uk 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
[quoted text clipped - 28 lines]
>
> -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
apm35@student.open.ac.uk - 29 Nov 2007 11:38 GMT
> On Nov 28, 6:32 am, ap...@student.open.ac.uk wrote:
> > > > I have just found a nasty race condition in my java servant which can
[quoted text clipped - 3 lines]
> > > That is according the standard unless the servant is registered under
> > > single-threaded POA.

> > OrbixWeb 3.0.x is ancient and quite different to the other IONA
> > products.

> Don't confuse event dispatching with POA threading policies.

I should have mentioned earlier that OrbixWeb 3.0.x is so ancient it
is before the POA was invented. The code in question has no choice but
to use the BOA.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.