Home Comments

A question on AMD/AMI chian

OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
AMD/AMI chain is thought as one of the most important features of ICE. Issue 11 had one detailed samples. But I get one question , what is its advantage over single AMD or AMI? When combine AMD with AMI, we actually put two underlying queues in runtime, one for AMI and another for AMI, is it more efficient than single one? what about the overhead to transfer the items in two queues?

Another question is : If vast of clients visit the server at the same time, the quests might pile up in the AMD internal queue, how about the AMD's underlying queue capacity ? If reach the maximum, the dispatching thread will be blocked?



  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    There isn't really a queue of AMD callbacks in the Ice runtime but even if there was one, queuing an object is not very expensive (at least compared to the other more expensive system calls required to send an invocation over the network).

    The advantage of AMD/AMI chaining is lower thread consumption. If you were not using AMI to make the invocation on the other peer, your server would have to wait for the response from the server thread. While the wait won't consume CPU because the thread will be put in the sleeping state, that thread can't be re-used for reading another request. So to dispatch other requests while this thread is sleeping, some other threads will be required. This wouldn't be necessary if you use AMI and AMD since once you make the AMI call you can release the server thread and later call on the AMD callback once the AMI response is received.

Sign In or Register to comment.