description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||
---|---|---|---|---|---|---|---|---|---|
Learn more about: CAtlAutoThreadModuleT Class |
CAtlAutoThreadModuleT Class |
11/04/2016 |
|
|
ae1667c6-3fb8-47bc-b35d-9ea5e9896d7f |
This class provides methods for implementing a thread-pooled, apartment-model COM server.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
template <class T,
class ThreadAllocator = CComSimpleThreadAllocator,
DWORD dwWait = INFINITE>
class ATL_NO_VTABLE CAtlAutoThreadModuleT : public IAtlAutoThreadModule
T
The class which will implement the COM server.
ThreadAllocator
The class managing thread selection. The default value is CComSimpleThreadAllocator.
dwWait
Specifies the time-out interval, in milliseconds. The default is INFINITE, which means the method's time-out interval never elapses.
Name | Description |
---|---|
CAtlAutoThreadModuleT::GetDefaultThreads | This static function dynamically calculates and returns the maximum number of threads for the EXE module, based on the number of processors. |
The class CAtlAutoThreadModule derives from CAtlAutoThreadModuleT
in order to implement a thread-pooled, apartment-model COM server. It replaces the obsolete class CComAutoThreadModule.
Note
This class should not be used in a DLL, as the default dwWait value of INFINITE will cause a deadlock when the DLL is unloaded.
IAtlAutoThreadModule
CAtlAutoThreadModuleT
Header: atlbase.h
This static function dynamically calculates and returns the maximum number of threads for the EXE module, based on the number of processors.
static int GetDefaultThreads();
The number of threads to be created in the EXE module.
Override this method if you want to use a different method for calculating the number of threads. By default, the number of threads is based on the number of processors.
IAtlAutoThreadModule Class
Class Overview
IAtlAutoThreadModule Class
Module Classes