Article ID: 282490 - View products that this article applies to.
This article was previously published under Q282490
This article has been archived. It is offered "as is" and will no longer be updated.
This article describes the differences in thread pools between Microsoft Transaction Server (MTS) and COM+ and how to write code that makes best use of this pool.
Thread Pool SchemeThe thread pool scheme is designed to accommodate a growing number of users for the application. The thread pool scheme differs between MTS and COM+.
Thread Pool in MTSIn MTS, each server package maintains a single thread pool of single-threaded apartment (STA) threads. The number of threads in the pool can range from 1 to 100 by default. All components run in STA; even if you mark the components "ThreadingModel=Free" in the registry, MTS ignores this setting. MTS allows one activity for each STA until all 100 threads are used. After all 100 threads are used, MTS starts to reuse existing threads for activities (which is called "multiplexing"). An MTS process has an additional number of threads that manage the process; however, these threads do not come out of the STA thread pool.
Thread Pool in COM+In COM+, each server application maintains two separate thread pools. One thread pool services STA objects, and another thread pool services free threaded components. The latter thread pool has no upper limit on the number of threads.
The COM+ thread pool size follows these rules:
Recommendations to Make the Best Use of the Thread Pool
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/291837/EN-US/ )INFO: Do Not Make Blocking Calls from an STA Component
(http://support.microsoft.com/kb/303071/EN-US/ )INFO: Registry Key for Tuning COM+ Thread and Activity