[omniORB] non-blocking calls ?

Duncan Grisby dgrisby@uk.research.att.com
Mon, 29 Nov 1999 17:30:24 +0000


On Monday 29 November, Philippe Moutarlier wrote:

> Is taht possible for a client to perform a non-blocking call to an
> object method which doesn't return any value ? Or should the server
> always have to create a thread for such a call in order to unblock
> the client before completion of the synchronous call ?

There are two ways to get non-blocking behaviour without doing calls
in separate threads. The first is to use oneway operations. This has
the advantage that the code to do the call is the same as normal. The
disadvantage is that in some circumstances oneway calls can still
block, if the underlying TCP connection's buffers fill up. It is also
possible for oneway invocations to be lost in flight.

The other method is to use the Dynamic Invocation Interface (DII),
where you can use send_deferred(), poll_response() and get_response()
to send requests and receive replies without blocking. This has the
advantage that you can do deferred calls on operations which have a
return value. The big problems are that you have to write a lot more
code, and you lose all compile-time type safety.

It often turns out best to do what you suggest and start separate
threads to do your "asynchronous" calls.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --