PooledAsync Sample: Increases Performance with an Additional Thread Pool
Demonstrates how to increase Web application and SOAP service availability and performance with an additional thread pool.
The PooledAsync sample contains two closely related samples demonstrating how to increase Web application and SOAP service availability and performance by incorporating an additional thread pool.
By default, the ATL Server framework provides very high performance by using a thread pool in the ISAPI Extension to handle incoming requests. If any of these requests takes a long time to complete, however, the possibility arises that the application or service will become unresponsive to additional requests. This situation may occur when a high percentage of the threads in the primary pool (in the ISAPI Extension) are busy with long-running tasks (validating credit cards, calling another SOAP server, and so on).
The solution demonstrated in this sample is to implement an additional thread pool and use ATL Server's asynchronous features to offload these long-running tasks.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.
Building and Running the Sample
To build and run this sample
Open the solution file, PooledAsync.sln, in the Visual Studio development environment.
Build the solution. This will also deploy the solution to the local Web server.
Use a Web browser to view http://localhost/pooledasync/index.htm. Use the links on the page to test the different ways that the Web application DLL provides for returning data to the client.
Open a command prompt in the folder that holds the SOAP client application, PooledAsyncSoapClient.exe, and run the application to test the ways that the XML Web service DLL provides for returning data to the client.
AtlServerRequest::dwRequestState | CAtlMap | CComCriticalSection | CHttpResponse::AsyncPrep | CIsapiExtension | CSoapHandler::SoapFault | CSoapSocketClientT | CStreamOnServerContext | CThreadPool | CThreadPool::Initialize | CThreadPool::QueryInterface | CThreadPool::QueueRequest | CThreadPool::Shutdown | DECLARE_ASYNC_HANDLER | HTTP_SUCCESS_ASYNC | HTTP_SUCCESS_ASYNC_DONE | Worker Archetype | WorkerArchetype::Execute | WorkerArchetype::Initialize | WorkerArchetype::Terminate