[omniORB] Single Thread Policy

David Riddoch djr@uk.research.att.com
Mon, 9 Oct 2000 13:59:40 +0100 (BST)


Hi Marcus,


You are right.  Single threaded policy in a POA just means that CORBA
requests within that POA will be serialised with respect to one-another.
They can still occur concurrently with the main thread and requests to
objects in other POAs (even if they are single-threaded!).

orb->work_pending() always returns 0 and orb->perform_work() does nothing
in omniORB.

You probably want to put mutex locks round accesses to the thread-unsafe
library.


Cheers,
David



On Mon, 9 Oct 2000 Marcus.Bullingham@aculab.com wrote:

> I am using a library which is not thread-safe, so in my server application I
> am creating servants which are activated on a new POA, created with the
> single-threading policy, for objects that interact with this library. Note,
> in my main thread I have to poll this library's event loop, so I am using
> the non-blocking event handling method via "if (orb->work_pending())
> orb->perform_work;" in order to alternate between polling the (omni)ORB & my
> (non-thread-safe) library for events.
> 
> However, I now think my initial assumption was wrong. I originally thought
> that, for a single-thread-policy POA, it would be the _main()_ thread which
> would be used to 'perform the work' i.e. up-calls into my objects. This
> seems not to be the case, since I see that the thread IDs of _main()_ and my
> object methods are different. So, I guess, the single-thread-policy only
> helps you if you are calling into a non-thread-safe library from your
> objects, but not if you need to call it from your main() thread.
> 
> Can somebody confirm this?