ATL Server Facilities


In this section you ll examine the services and tools provided by ATL Server to facilitate creating high-performance Web applications.

One of the ways to improve performance is to cache long-lived data in the CIsapiExtension class instead of creating or retrieving it on every request. For more information on the ATL Server caching facilities, see Chapter 12.

The ATL Server framework also provides simple ways to take advantage of per-thread data and per-thread services. The benefit here is that synchronization costs are avoided because each thread maintains a separate instance of the data or the service. For example, ATL Server uses a per-thread heap to allocate the request handler class when dealing with synchronous requests , thus avoiding the costs of synchronizing on the Win32 heap. ATL Server also provides a data source cache as a per-thread service. The cache eliminates the cost of opening and closing a database connection in every request, and by making it per-thread, the cost of any interthread marshaling is also eliminated.

In addition, ATL Server provides facilities to leverage knowledge about the lifetime of a request. For example, instead of using the normal heap or even the per-thread heap that ATL Server provides, it s possible to write a custom allocator that s optimized for a per-request usage. That is, it s fairly straightforward to write an arena allocator that simply moves a pointer for allocations and does nothing on any free operation. The pointer is reset at the beginning of a request. Using an arena allocator, it s possible to eliminate even more overhead than when you re using a per-thread, unsynchronized Win32 heap.




ATL Server. High Performance C++ on. NET
Observing the User Experience: A Practitioners Guide to User Research
ISBN: B006Z372QQ
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net