![]() |
CThreadPool | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: ThreadPool.h |
Copyright (c) 2000-2003 Barak Weichselbaum <barak@komodia.com> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Contact info:
Site: http://www.komodia.com Main contact: barak@komodia.com For custom projects, consulting, or other paid services: sales@komodia.com
![]() |
JobVector | m_aJobList | Our vector |
![]() |
BOOL | m_bDrop | Do we drop extra data ? |
![]() |
BOOL | m_bInitialized | Is the pool initialized |
![]() |
DWORD | m_dwSleepInterval | Sleep interval for the semaphore |
![]() |
int | m_iMaxJobsPending | Max jobs pending |
![]() |
int | m_iRunningThreads | Our running thread count |
![]() |
CGenericCriticalSection * | m_pCSection | Our CS |
![]() |
CGenericCriticalSection * | m_pCSectionCounter | |
![]() |
ThreadData * * | m_ppThreadData | Thread data |
![]() |
CGenericThread * * | m_ppThreads | Our array of threads |
![]() |
CGenericSemaphore * | m_pSemaphore | Our semaphore |
![]() |
unsigned long | m_ulJobsCount | Number of jobs |
![]() |
unsigned long | m_ulThreadCount | Number of thread |
![]() |
CThreadPool( const CThreadPool& rPool ) |
No copy Ctor | |
![]() |
CThreadPool( unsigned long ulNumberOfThreads, unsigned long ulMaxJobsPending=THREAD_POOL_DEFAULT_JOBS, LPInitializePoolProc pInitializeProc=NULL, CGenericThread::ThreadPriority aPriority=CGenericThread::tpNormal ) |
Ctor and Dtor ulNumberOfThreads - Number of active threads ulMaxJobsPending - Size of the back queue pInitializeProc - Initialize proc aPriority - Threads priority |
![]() |
virtual |
![]() |
void | Clear() |
Clear the data |
![]() |
void | delete all the threads | |
![]() |
void | GetJob( JobData& aData ) |
Get a job |
![]() |
DWORD | GetMaxThreads() const |
Get the number of threads |
![]() |
int | GetRunningThreads() const |
Get the number of running threads |
![]() |
CGenericSemaphore * | GetSemaphore() const |
Get the semaphore |
![]() |
int | GetWaitingJobs() const |
How many jobs we have |
![]() |
BOOL | IsFinished() const |
Did we finish running |
![]() |
BOOL | IsInitialized() const |
Is the pool initialized ? |
![]() |
CThreadPool & | operator =( const CThreadPool& rPool ) |
No assignment operator |
![]() |
static DWORD | PoolThread( LPVOID pParam ) |
Our thread proc |
![]() |
void | ReSetThreadCount( int iIncrement ) |
We have another or less thread running |
![]() |
void | SetExtraDataDrop( BOOL bDrop ) |
Do we allow extra data to block, or to be dropped ? |
![]() |
void | SetSleepInterval( DWORD dwSleepInterval ) |
Set the sleep interval |
![]() |
BOOL | SpawnThreads( LPInitializePoolProc pInitializeProc, CGenericThread::ThreadPriority aPriority ) |
Create the threads |
![]() |
BOOL | SubmitJob( LPThreadPoolProc pJobProc, LPThreadDWORDPoolProc pDWORDJobProc, LPThreadPoolDataProc pDataProc, LPVOID lpData ) |
Submit the job localy |
![]() |
BOOL | SubmitJob( LPThreadPoolProc pJobProc, LPVOID lpData ) |
Add a job |
![]() |
BOOL | SubmitJob( LPThreadDWORDPoolProc pJobProc, LPVOID lpData ) |
|
![]() |
BOOL | SubmitJob( LPThreadPoolDataProc pJobProc, LPVOID lpData ) |
ErrorHandler.h | |
GenericThread.h | |
deque |
stdafx.h | for precompiled header directive |
ThreadPool.h | |
ErrorHandlerMacros.h | |
GenericSemaphore.h | |
GenericCriticalSection.h | |
GenericEvent.h | |
WaitList.h | |
OSManager.h |
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |