Archived

This forum has been archived. Please start a new discussion on GitHub.

AMD callbacks and threading

kwaclaw
kwaclaw Oshawa, Canada
I have read the docs, but I am not clear about how AMD callbacks are processed. My basic design is this:
  1. Server receives requests and creates + adds jobs to inbound queue (this is done one an ICE thread)
  2. Application thread 1 takes job from inbound queue, processes it and adds job results to outbound queue
  3. Application thread 2 takes job result from outbound queue, and calls back on the AMD callback object

Now my question is, does the ICE runtime perform the outbound IO on application thread 2, or is the callback again queued somewhere in the runtime and sent back to the client on a thread from the ICE thread pool?

If the latter is the case, then I don't need application thread 2, I think.

Karl

Comments

  • benoit
    benoit Rennes, France
    Hi,

    If you're using Ice 3.3.0, you don't really need thread #2: sending the response can't block. The Ice runtime tries to send the response from the thread calling ice_response but as soon as it might block, the control is returned and the remainder of the response is sent in the background from an Ice thread.

    If you're using a version prior to 3.3.0, the response is sent synchronously and can block so you'll need thread #2 if you don't want to block thread #1.

    Cheers,
    Benoit.
  • kwaclaw
    kwaclaw Oshawa, Canada
    benoit wrote: »
    Hi,

    If you're using Ice 3.3.0, you don't really need thread #2
    Cheers,
    Benoit.

    Thanks, that helps. :)

    Karl