|
|
|
|||||
|
Number of threads/Connections used when submitting multiple AMI methods
If my programming/interaction model is as follow:
1. Client application may interact with multiple services (may share, but don't have too, the same Communicator or Adaptor). 2.At each "interaction" the client is sending multiple AMI request (to one or more services) and then waits and collects all responses or any completed response up to a certain timeout. 3. A client can have multiple threads that can work in the mode described above concurrently. My understanding is as follow: 1. At the service side each AMI call will use/occupy a thread (which can belong to the communicator or Adaptor thread pool) for the duration of the call unless AMD is used (but than the programmer is responsible for the execution and returning the results in a different thread). 2. At the client side each AMI call will use/occupy a thread until the AMI callback. 3. I assume that per adaptor two Connections are needed (we are not using bi-directional connection) and all concurrent client requests are multiplexed via the same connection (and the same applies to service response). Is that the above description correct? If so, is there anything I can do to reduce the number of concurrent threads? Any advice on handling client side response time out (Connection timeout looks to harsh for this case)? Thanks, Arie. |
|
||||||
|
Hi,
Quote:
Quote:
Quote:
Quote:
Cheers, Benoit. |
|
|||||
|
Thanks!
As for 3 I probably got confused by section 37.7 of the manual and thought that response to a method call comes via a different connection (I assume now that this section is related to callbacks and not to standard method calls). Is there a way to "flag" the AMI call as canceled, so that any waiting tasks (not yet executed - blocked on the thread pool) will be avoided and any completed task response will be dropped? |
|
|||||
|
Thank you very much.
In my case they are not long running tasks, I was more concern about the volume of concurrent requests and trying to optimize resources (cpu & network bandwidth). Response is not going to be used if retrieved later than N seconds and I would prefer not working on it or submitting it back and dropping it on the client side. I guess I can use AMD and propagate "max response". When my "execution" thread takes it from the queue it will consider this value and return null or exception if exceeded the timeout. I assume returning null is lighter than returning a full payload or exception propagation. |
![]() |
| 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 |
| Multiple ice_response to a single AMI callback | kishore | Help Center | 3 | 06-05-2007 11:08 PM |
| Create C# threads as background threads? | bpolivka | Help Center | 19 | 01-31-2007 06:36 PM |
| Multiple incoming connections on same proxy | g00fy | Help Center | 4 | 07-01-2006 08:26 AM |
| Can I increase the number of simultaneous connections by increasing ThreadPool.Size? | timeguest | Help Center | 2 | 06-23-2005 06:23 AM |
| Multiple threads smashing the stack | Ric | Help Center | 8 | 06-09-2005 01:55 PM |