description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: IThreadPoolConfig Interface |
IThreadPoolConfig Interface |
11/04/2016 |
|
|
69e642bf-6925-46e6-9a37-cce52231b1cc |
This interface provides methods for configuring a thread pool.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
__interface
__declspec(uuid("B1F64757-6E88-4fa2-8886-7848B0D7E660")) IThreadPoolConfig : public IUnknown
Name | Description |
---|---|
GetSize | Call this method to get the number of threads in the pool. |
GetTimeout | Call this method to get the maximum time in milliseconds that the thread pool will wait for a thread to shut down. |
SetSize | Call this method to set the number of threads in the pool. |
SetTimeout | Call this method to set the maximum time in milliseconds that the thread pool will wait for a thread to shut down. |
This interface is implemented by CThreadPool.
Header: atlutil.h
Call this method to get the number of threads in the pool.
STDMETHOD(GetSize)(int* pnNumThreads);
pnNumThreads
[out] Address of the variable that, on success, receives the number of threads in the pool.
Returns S_OK on success, or an error HRESULT on failure.
[!code-cppNVC_ATL_Utilities#134]
Call this method to get the maximum time in milliseconds that the thread pool will wait for a thread to shut down.
STDMETHOD(GetTimeout)(DWORD* pdwMaxWait);
pdwMaxWait
[out] Address of the variable that, on success, receives the maximum time in milliseconds that the thread pool will wait for a thread to shut down.
Returns S_OK on success, or an error HRESULT on failure.
See IThreadPoolConfig::GetSize.
Call this method to set the number of threads in the pool.
STDMETHOD(SetSize)int nNumThreads);
nNumThreads
The requested number of threads in the pool.
If nNumThreads is negative, its absolute value will be multiplied by the number of processors in the machine to get the total number of threads.
If nNumThreads is zero, ATLS_DEFAULT_THREADSPERPROC will be multiplied by the number of processors in the machine to get the total number of threads.
Returns S_OK on success, or an error HRESULT on failure.
See IThreadPoolConfig::GetSize.
Call this method to set the maximum time in milliseconds that the thread pool will wait for a thread to shut down.
STDMETHOD(SetTimeout)(DWORD dwMaxWait);
dwMaxWait
The requested maximum time in milliseconds that the thread pool will wait for a thread to shut down.
Returns S_OK on success, or an error HRESULT on failure.