NCBI C++ ToolKit
|
Search Toolkit Book for CPoolOfThreads_ForServer
#include <connect/impl/thread_pool_for_server.hpp>
Public Types | |
typedef CThreadInPool_ForServer | TThread |
typedef CBlockingQueue_ForServer | TQueue |
typedef TQueue::TItemHandle | TItemHandle |
typedef TQueue::TRequest | TRequest |
Public Member Functions | |
CPoolOfThreads_ForServer (unsigned int max_threads, const string &thr_suffix) | |
Constructor. More... | |
virtual | ~CPoolOfThreads_ForServer (void) |
Destructor. More... | |
void | Spawn (unsigned int num_threads) |
Start processing threads. More... | |
void | AcceptRequest (const TRequest &request) |
Put a request in the queue with a given priority. More... | |
TItemHandle | GetHandle (void) |
void | KillAllThreads (bool wait) |
Causes all threads in the pool to exit cleanly after finishing all pending requests, optionally waiting for them to die. More... | |
Private Types | |
typedef CAtomicCounter::TValue | TACValue |
typedef list< CRef< TThread > > | TThreads |
Private Member Functions | |
TThread * | NewThread (void) |
Create a new thread. More... | |
bool | Register (TThread &thread) |
Register a thread. More... | |
void | UnRegister (TThread &) |
Unregister a thread. More... | |
Private Attributes | |
volatile TACValue | m_MaxThreads |
The maximum number of threads the pool can hold. More... | |
CAtomicCounter | m_ThreadCount |
The current number of threads in the pool. More... | |
CMutex | m_Mutex |
The guard for m_MaxThreads and m_MaxUrgentThreads. More... | |
TQueue | m_Queue |
string | m_ThrSuffix |
TThreads | m_Threads |
bool | m_KilledAll |
Friends | |
class | CThreadInPool_ForServer |
Definition at line 212 of file thread_pool_for_server.hpp.