|
|
|
|||||
|
Asynchronous invocation
Hi there!
First I would like to mention that I tried to use AMI for the first time this weekend and would like to admit that I'm really impressed by the simpleness of your solution. Took me about 10 minutes to convert a synchronously called function into an asynchronous one. What's remaining for me is the question what I should use: AMI or AMD. I read the manual and understood: - AMI has the disadvantage of being able to be executed only a limited number of times (-> threadpool boundings) - AMD has the disadvantage of possibly being delayed for later execution My setup is that I'm distributing commands from a single server to a bunch of clients in order to make them execute certain things (to explain it simple). To adress the disadvantages: - I don't know about the number of clients - Execution should start within a timeframe of ~ 2 seconds Can you give me an advise on what method to use for this case or give me statements on how big the actual disadvantages are or if I forgot some? regs, Stephan |
|
|||||
|
Quote:
Quote:
Quote:
Is this a case for synchronous calls or for asynchronous calls or, if the prior, what is a case for asynchronous calls at all? regs, Stephan |
|
||||||
|
I'm afraid I'm still confused. What exactly is the interaction of the client with the server?
AMI allows a client to invoke a request on a server, but not to wait for the answer. Instead, you get a callback when the answer arrives from the server. If you do not need a response from the server at all, then you should use a oneway requests. AMD allows a server to either return an answer before processing on the server has finished, or it allows you to return an answer later, i.e., you first return the dispatch thread back to the server thread pool, and then send an answer later, for example, as the result of a callback from some worker thread, a database system, an AMI call, etc. |
|
|||||
|
Hi again!
Quote:
The interface could look like this interface client { void runMe(); }; Quote:
My question in turn is why there are two models that are so similar (not only because the first two letters are the same :-) ). Sorry to ask such a religious question but it would be interesting to know more about your design decisions! I suppose in my use case, AMI is the way to go! regs, Stephan |
|
||||||
|
Quote:
Quote:
AMD is asynchronous dispatch by an Ice server, meaning that you decide when to send the response. The response is not tied to the return of the operation that dispatches a request. Quote:
For AMI, the client-side Ice core calls back your code when the response from an Ice server arrives. For AMD, you call the server-side Ice core when you want to send a response to an Ice client. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Asynchronous Programming | ty263 | Help Center | 2 | 12-01-2006 08:46 AM |
| Asynchronous Method Invocation Samples | pradeep | Help Center | 1 | 11-23-2006 05:55 AM |
| Asynchronous - AMI and AMD | mohdiarra | Help Center | 10 | 10-18-2006 10:30 PM |
| Documentation on Asynchronous Method Invocation | csapuntz | Help Center | 1 | 05-07-2003 04:59 PM |
| Server Scalability & Asynchronous IO | Ken Carpenter | Comments | 11 | 03-02-2003 06:28 PM |