all groups > dotnet component services > march 2008 >
You're in the

dotnet component services

group:

Asynchronous COM+ Method Calls?



Asynchronous COM+ Method Calls? John Saunders [MVP]
12/24/2007 3:34:44 PM
dotnet component services: If I have a COM+ method that returns results from a long-running database
query, is there a way to create a version of the method that uses one of the
..NET asynchronous calling patterns? Assume that I can use any technology I
like.

My interest is in creating asynchronous web pages for use in a high-volume
web application. It's a bad idea to block the ASP.NET worker threads by,
for instance, blocking on a COM+ method call.
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

Re: Asynchronous COM+ Method Calls? Brian Muth
12/27/2007 9:35:58 AM
[quoted text, click to view]

Since Windows 2000, COM has supported asynchronous method calls. See http://msdn.microsoft.com/msdnmag/issues/0400/async/.

Note that the implementation for the asynchronous architecture is confined to the proxy, so this should work just fine with COM+
objects.

Personally, I have never used this support, preferring instead to launch a worker thread internal to the COM+ object to do my
asynchronous work. Obviously you can do the same.

Brian


Re: Asynchronous COM+ Method Calls? John Saunders [MVP]
12/27/2007 6:18:13 PM
[quoted text, click to view]

Thank you very much. Not only do I not remember seeing that particular
article; I also don't remember hearing any mention of async COM calls.
"There must be something wrong with them", because they're too good to be
true!
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

Re: Asynchronous COM+ Method Calls? caractacus
3/7/2008 1:01:01 AM
Interface queueing is another option for long-running processes.

[quoted text, click to view]
Re: Asynchronous COM+ Method Calls? caractacus
3/7/2008 1:13:00 AM
Another memory sparked:

I can't locate the source, but a reputable source noted that the .NET thread
pool is quickly exhausted by high volume blocking COM+calls, resulting in a
severe scalability issue.

A recommended solution was to access COM+ components via async web service
proxy, thereby returning the threads to the pool while the COM+ calls execute
over SOAP.

This results in a very clean, scalable solution. There is more call overhead
resulting in slightly longer call times and increased network traffic, so
this might be used for long-running processes only.


[quoted text, click to view]
Re: Asynchronous COM+ Method Calls? John Saunders [MVP]
3/7/2008 10:16:40 AM
[quoted text, click to view]

Thanks for the answer (though I had almost forgotten the question).

But, what is interface queuing? Can you provide some links?
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Re: Asynchronous COM+ Method Calls? John Saunders [MVP]
3/7/2008 10:59:16 AM
[quoted text, click to view]

This is true, and widely known. In fact, the general issue is that ASP.NET
uses the thread pool to process incoming requests. If you then tie up those
threads, for any reason (not just COM+), then you are reducing the number of
threads available to process incoming requests. This can easily lead to a
situation where all thread pool threads are busy doing nothing - just
waiting for something to happen. When this happens, requests will be queued.
After a while, they may even start being rejected with a "server busy" error
code.

[quoted text, click to view]

This should work, though I'd recommend being careful to only expose your
COM+ operations locally. I'd also suggest that this may be helpful for more
than just long-running calls, if you get into the thread-pool starvation
problem I discussed above.

One question I have is whether there is one ASP.NET thread pool per Web
Application or per worker process (aspnet_wp or w3wp). If only one per
process, then you'll need to ensure that the COM+ "web services" are served
on another worker process (different application pool).

I'll also note that I've seen it mentioned that WCF can also expose COM+
components. See the "COM+ Service Model Configuration Tool".
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

AddThis Social Bookmark Button