[omniORB] Single-Threading POA Policy
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 23 Oct 2000 15:03:45 +0100
On Monday 23 October, vonWedel@lfpt.rwth-aachen.de wrote:
> The problem I have is that, using PythonWin, a COM object reference
> marshalled in one thread cannot be used for calls in another.
>
> Unfortunately, exceuting subsequent calls in distinct threads is the
> way omniORB handles things, even when configuring a new POA to do
> single threading.
>
> Is there any way to circumvent this?
No, I'm afraid omniORB always does its own thing with regards to
threads. The only thing you can ask it to do is to serialise access to
all objects in a POA. There is no way to make sure it is always the
same thread.
The only solution is to create your own thread concentrator. It
doesn't need to be a queue if you also use a single-threaded POA. You
can just create an active object (i.e. one with its own thread) to
which you give a function and the arguments to call. The object does
the necessary thread synchronisation, and calls the function in the
context of its own thread. The return value can then be passed back in
the same way.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --