[omniORB] Single Thread Policy

Marcus.Bullingham@aculab.com Marcus.Bullingham@aculab.com
Mon, 9 Oct 2000 13:49:44 +0100


Hi,

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?

Thanks very much,

Marcus.