Asynchronous Distributed Object Calls

  • Is there a limit to the number of oneway calls to a DO instance before
    it starts blocking?  I've noticed that if I make about 6 async
    requests (none of which are completed by the time the last call is
    made) the seventh call blocks in the caller.

    Thanks,
    -Adam
  • Yes, there is a limit and it depends on the Mach port's queue size.

    --
    Julien

    Sent from my iPod Touch

    Le 10 févr. 08 à 21:15, Adam Thorsen <adam.thorsen...> a
    écrit :

    > Is there a limit to the number of oneway calls to a DO instance
    > before it starts blocking?  I've noticed that if I make about 6
    > async requests (none of which are completed by the time the last
    > call is made) the seventh call blocks in the caller.
    >
    > Thanks,
    > -Adam
  • On 10 Feb '08, at 12:15 PM, Adam Thorsen wrote:

    > Is there a limit to the number of oneway calls to a DO instance
    > before it starts blocking?  I've noticed that if I make about 6
    > async requests (none of which are completed by the time the last
    > call is made) the seventh call blocks in the caller.

    IIRC, this is because the Mach message queue used by DO has a limited
    fixed size. To avoid overflowing the queue, it blocks until there's
    room.

    We ran into this problem while implementing the first version of the
    iChatAgent; it could get stuck this way and hang if a client process
    also hung. I call this kind of spreading system freeze a "tar-baby".
    At the time, I believe the engineer who fixed the bug ended up having
    to implement a background thread pool for dispatching asynchronous DO
    messages. If no threads were ready to send another message, it would
    just create a new one.

    (My personal opinion is that DO is kind of dangerous — an "attractive
    nuisance" in legalese. It gives the impression of making everything
    really easy, but there are nasty details like this that complicate
    things. I also kept running into strange and nasty ref-counting
    crashers that I was somehow never quite smart enough to figure out how
    to fix. But maybe that's just me.)

    —Jens